[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem reading root element in XML Stylesheet bas

Subject: Re: Problem reading root element in XML Stylesheet based XML document
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 31 Jan 2003 12:42:49 -0500
xml stylesheet xsd
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@xxxxxxxxxxxxxxxx
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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.