Problem with namespace declaration
Hi,
I'm trying to transform some XML that begins with the following:
<?xml version="1.0" encoding="UTF-8"?>
<release xmlns="[url of xsd]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="[url of xsd]">
... this doesn't work. When I try transforming, I am left with an empty XML document, with only an empty root element.
If I change the tag to this:
<?xml version="1.0" encoding="UTF-8"?>
<release xmlns="[url of xsd]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="[url of xsd]">
... then everything works fine.
My XSL looks like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.juno.co.uk/digital BulkImportSchema.xsd" xmlns:jd="[my domain]" xmlns:sc="[url of their XSD]">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:element name="transformedRelease">
<xsl:apply-templates select="release"></xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template match="release">
..... etc ....
My question is, is the XML I've been given possible to transform, and if it is, how do I do it? Or do I need to request a different format?
cheers,
Alex
|