xsl-list
[Top] [All Lists]

Re: Problem reading root element in XML Stylesheet based XML document

2003-01-31 10:42:49
Chris,

The default namespace declaration in your source document

xmlns="publicid:org.xCBL:schemas/XCBL35/Order.xsd"

is throwing off your stylesheet. It won't recognize the document element (or any other) since it doesn't know the namespace they're in, and so doesn't know that that's what you're trying to match.

Duplicate that declaration in the stylesheet (or remove it from the source) and you should be okay.

I hope that helps!

Cheers,
Wendell

At 06:06 PM 1/31/2003, you wrote:
I am having a problem reading the root element when performing an XSL
Transformation on an XML file that is based on an XML Schema. The
transformation is successful, however, if I base the XML document on a DTD
file instead.

Is there any special configuration that I need for the transformer to
recognize the top-level element? or is there a syntax change that I need to
make to the XSL file? I am including the top portions of the XML and XSL
files here...if the XSL file recognizes the root element, then I should get
the display text. This is successful if I use the DTD based file, rather
than the schema based file. Any ideas?

XML -
<?xml version="1.0" encoding="UTF-8"?>
<Order xmlns="publicid:org.xCBL:schemas/XCBL35/Order.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="publicid:org.xCBL:schemas/XCBL35/Order.xsd
D:\temp\OrderDIP_v2.3.xsd">
 <OrderHeader>
  <OrderNumber>
   <BuyerOrderNumber>35353535</BuyerOrderNumber>
  </OrderNumber>
  <OrderIssueDate>20030123T01:00:00</OrderIssueDate>
  ...
 </OrderHeader>
</Order>

XSL -
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="text"/>

<xsl:template match="Order">
<xsl:text>Print this text if the root element is matched</xsl:text>
</xsl:template>
...
</xsl:stylesheet>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list