[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Sheflug] OT XML help required
I know its off topic but ... if there any xml whiz's out there can give me a
couple of pointers.
I'm trying to use a xslt to get some info out of a bunch of xml docs.
It works fine until some of the xml have a default name space- in which case
my transform gives me now output - I presume its because i'm not matching
any data.
The xml
<?xml version="1.0" ?>
<manifest identifier="MANIFEST1"
xmlns="http://www.imsproject.org/xsd/ims_cp_rootv1p1"
xmlns:imsmd="http://www.imsproject.org/xsd/ims_md_rootv1p1">
<metadata>
<schema>IMS Content</schema>
<schemaversion>1.1</schemaversion>
</metadata>
</manifest>
the xsl
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns="http://www.imsproject.org/xsd/ims_cp_rootv1p1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:imsmd="http://www.imsproject.org/xsd/ims_md_rootv1p1">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<!-- Referencing a data value as element content: -->
<title><xsl:value-of select="//metadata/schema"/></title>
</head>
<body>
<h1><xsl:value-of select="//metadata/schema"/></h1>
<h1><xsl:value-of select="//metadata/schemaversion"/></h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I'm a complete newbie at this so any pointers welcome!
AED
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.