SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Scottsdale
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Processing XSLT with PHP Problem

    From what I understand, browsers sometimes display extra space between table rows if there is a newline after a </td> tag. It seems that this should fix the problem:

    <xsl:output method="html" encoding="ISO-8859-1" indent="no" omit-xml-declaration="yes"/>
    <xsl:strip-space elements="*"/>

    but when I view source, my code is still being indented. I think the problem must be in the way the php must be processing the template.

    Here is my processing code:

    $xsl_file = $config[ 'PATH_TEMPLATE' ]."/$file";
    $arguments = array(
    '/_xml' => $xml,
    );
    $xh = xslt_create();
    $result = xslt_process($xh, 'arg:/_xml', $xsl_file, NULL, $arguments);
    if ($result) {
    print $result;

    }
    else {
    print "Sorry, sample.xml could not be transformed by sample.xsl into";
    print " the \$result variable the reason is that " . xslt_error($xh) .
    print " and the error code is " . xslt_errno($xh);
    }
    xslt_free($xh);

    Anyone have any ideas?

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ate50eggs
    Anyone have any ideas?
    HTML Code:
    <xsl:output
      method = "xml" | "html" | "text" | QName 
      version = nmtoken 
      encoding = string
      omit-xml-declaration = "yes" | "no"
      standalone = "yes" | "no"
      doctype-public = string 
      doctype-system = string 
      cdata-section-elements = QNames 
      indent = "yes" | "no"
      media-type = string 
    />
     
    try
    HTML Code:
    <xsl:value-of select="normalize-space(.)" />
    Last edited by Andrew-J2000; Jun 10, 2004 at 14:54. Reason: Ignore, didn't read the question properly.

  3. #3
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Word of advice, do not post in more than one forum, please.

    It is very annoying, and bumps down other members with their problems which is selfish to put it politely

  4. #4
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Scottsdale
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Andrew: no luck...the code is being indented.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •