|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: ***********Transformation of an XML document conta
Hip hei! > "element.xml" --> > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <element xmlns="http://www.e-xmlmedia.com/test/"> > <titi>titi</titi> > <toto>toto</toto> > <tata>tata</tata> > </element> > > in this one : > "result.xml"--> > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <ELEMENT xmlns="http://www.e-xmlmedia.com/test/"> > <TITI>titi</TITI> > <TOTO>toto</TOTO> > <TATA>tata</TATA> > </ELEMENT> > > via this stylesheet : > "element.xsl" --> > <xsl:stylesheet version="1.0" xmlns="http://www.e-xmlmedia.com/test/" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:template match="/element"> You can't use the default namespace here, see http://www.w3.org/TR/xslt#section-Expressions, second list, 5th item. > <ELEMENT xmlns="http://www.e-xmlmedia.com/test/"> You don't need this, as you've already declared the namespace in the xsl:stylesheet > <xsl:apply-templates /> > </ELEMENT> > </xsl:template> > <xsl:template match="test:titi"> You haven't declared the test namespace, so this will not match your source. If you declare xmlns:test="http://www.e-xmlmedia.com/test/" somewhere in scope for this element, it'll work > <TITI> > <xsl:value-of select="." /> > </TITI> > </xsl:template> > <xsl:template match="test:toto"> > <TOTO> > <xsl:value-of select="." /> > </TOTO> > </xsl:template> > <xsl:template match="test:tata"> > <TATA> > <xsl:value-of select="." /> > </TATA> > </xsl:template> > </xsl:stylesheet> You should use, however, use just one template to do the uppercasing thingy, instead of hard coding those like you have above. Jarno XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








