JonBroadley
Programmer
I'm fairly new to XML and after battling through a few problems I have finally reached one that I am completely stuck on. I am trying to read in a SCORM manifest file, I have created a manifest using reload tools ( then updated the xsd schemas to the latest version from the imsglobal ( servers to clear some code warnings.
I have now created an xsl file to extract the data to create a treeview in ASP.Net2 the file works up to a point. If I cut down the initial manifest line from
<manifest
identifier="imsmdv1p2p1_manifest"
xmlns=" xmlns:imsmd=" xmlns:xsi=" xsi:schemaLocation=" imscp_v1p1.xsd
imsmd_v1p2p4.xsd"
version="IMS CP 1.1.3">
to
<manifest
identifier="imsmdv1p2p1_manifest"
version="IMS CP 1.1.3">
I can read and display the file in a tree view. If I leave it as is then all I get is my root node.
The xsl file is as follows:-
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl=" xmlns:xsi=" xmlns:xsd=" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>
<xsl:strip-space elements="*"/>
<xsl
utput method="xml"
omit-xml-declaration="yes"
indent="yes"
standalone="yes" />
<xsl:template match="/">
<xsl:element name="Lesson">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="//item">
<xsl:element name="item">
<xsl:attribute name="identifierref">
<xsl:value-of select="@identifierref"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title"/>
</xsl:attribute>
<xsl:apply-templates />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
The code can be seen at
If anyone has any suggestions about what the problem could be then I would be really grateful.
Jon
I have now created an xsl file to extract the data to create a treeview in ASP.Net2 the file works up to a point. If I cut down the initial manifest line from
<manifest
identifier="imsmdv1p2p1_manifest"
xmlns=" xmlns:imsmd=" xmlns:xsi=" xsi:schemaLocation=" imscp_v1p1.xsd
imsmd_v1p2p4.xsd"
version="IMS CP 1.1.3">
to
<manifest
identifier="imsmdv1p2p1_manifest"
version="IMS CP 1.1.3">
I can read and display the file in a tree view. If I leave it as is then all I get is my root node.
The xsl file is as follows:-
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl=" xmlns:xsi=" xmlns:xsd=" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>
<xsl:strip-space elements="*"/>
<xsl
omit-xml-declaration="yes"
indent="yes"
standalone="yes" />
<xsl:template match="/">
<xsl:element name="Lesson">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="//item">
<xsl:element name="item">
<xsl:attribute name="identifierref">
<xsl:value-of select="@identifierref"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title"/>
</xsl:attribute>
<xsl:apply-templates />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
The code can be seen at
If anyone has any suggestions about what the problem could be then I would be really grateful.
Jon