Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> XML Transformation: Insert schema reference in output doc ( Beginners question )
Hello,
I have a Stylesheet which works fine except for inserting a reference to a schema file in my output file.
The schema file is located on
http://www.agrolab.de/sikb/xsd-labresultaatgegevens_SIKB_0101_versie_3.6.0.xsd"
I don't have any namespace defined myself
I want my output doc to look like this
<?xml version="1.0" encoding="UTF-8"?>
<labresultaat
xsi:schemaLocation="http://www.element-examples.org http://www.agrolab.de/sikb/xsd-labresultaatgegevens_SIKB_0101_versie_3.6.0.xsd"
xmlns="http://www.element-examples.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <projectgegevens> ........
This is my Stylesheet ( the last of many different tries ):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"/>
<xsl:template match="XML_REPORT">
<labresultaat
xmlns="http://www.element-examples.org" xsi:schemaLocation="http://www.element-examples.org http://www.agrolab.de/sikb/xsd-labresultaatgegevens_SIKB_0101_versie_3.6.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
If I transform my XML using the above Stylesheet I get output doc as
follows:
<?xml version="1.0" encoding="UTF-8"?>
<labresultaat xsi:schemaLocation="http://www.element-examples.org
http://www.agrolab.de/sikb/xsd-labresultaatgegevens_SIKB_0101_versie_3.6.0.xsd"
xmlns="http://www.element-examples.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<projectgegevens xmlns="">
......
which is not valid because of the xmlns="" within <projectgegevens
xmlns="">
Removing manually xmlns="" makes the outputfile valid.
How can I insert the schema reference in <labresultaat> without destroying my <projectgegevens>-Tag ?
Thank you in advance for your help
Willy
Received on Tue Feb 14 2006 - 04:37:07 CST