|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, I'm trying to convert an xml document using xslt but have run into a problem: the xml document contains an attribute xmlns in some of it's elements
eg: <content> <table> <selection xmlns="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" id="1"/> </table> </content> My xslt document: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xsl:output method="xml" encoding="UTF-8"/> <xsl:template match="/content"> <xsl:for-each select="table"> <check> <xsl:for-each select="selection"><xsl:value-of select="id"/> </xsl:for-each> </check> </xsl:for-each> </xsl:template> </xsl:stylesheet> expected output: <?xml version="1.0" encoding="UTF-8"?><check xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</check> actual output: <?xml version="1.0" encoding="UTF-8"?><check xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> Is there anything I can do so that the selection element is actually read? |
|
#2
|
|||
|
|||
|
well, someone helped me out again...
I have to declare xmlns:ims="http://www.imsglobal.org/xsd/ims_qtiasiv1p2" in the beginning, and then use <xsl:for-each select="ims:selection"></xsl:for-each> |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > xslt Name space problems in xml |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|