Hello,

My PHP code is:
---------------------

       $xml = new DOMDocument;
$xml->load($this->_payload);
          $xsltProcessor = new XsltProcessor();
       $xsl = new DomDocument;
       $xsl->load('../lib/Transformations/text.xsl');
$xsltProcessor->importStylesheet($xsl);
       $result = $xsltProcessor->transformToXml($xml);
return $result;


My XSL is:
--------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
xmlns="http://www.w3.org/1999/xhtml";
>
<xsl:template match="/">
<xsl:element name="Data">
<xsl:element name="AccountNumber"><xsl:value-of select="//datait...@name='AccountNumber']/@value"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>


And my XML is:
---------------------

<ProfileRequest templateId="1" submitUser="asdf" submitDateTime="2009-01-12T17:32:46">
   <DataItem name="AccountNumber" value="600978"/>
</ProfileRequest>



The $result is:
-----------------

<?xml version="1.0"?>
<Data xmlns="http://www.w3.org/1999/xhtml";><AccountNumber></AccountNumber></Data>

So, as you can see the AccountNumber is missing. This XSL/XML works fine in Author (XML Tool). Any ideas why this would fail? Also, the Xpath (//datait...@name='AccountNumber']/@value) works
if I make the XML a simpleXML object and call xpath on it.

Thanks for your help!

- Ben
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php

Reply via email to