Jump to content

XSLTProcessor help!


timbrown

Recommended Posts

Hello, I though I had fixed this one but oh no!

 

something.xml

<app>
  <id>app1</id>
</app>

 

something.xsl

<xsl:template match="app">
  <div><xsl:apply-templates/></div>
</xsl:template>

<xsl:template match="id">
  <xsl:attribute name="id">
    <xsl:value-of select="."/>
  </xsl:attribute>
</xsl:template>

 

in IE this outputs something like -

<div id="app1"></div>

 

but when I use php XSLTProcessor I get the message - "Cannot add attributes to an element if children have already been added to the element".

 

Help! I have been struggling with this...

Link to comment
https://forums.phpfreaks.com/topic/55262-xsltprocessor-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.