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

RE: x-schema in source xml causing no matches...

Subject: RE: x-schema in source xml causing no matches...
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 21 Jul 2004 09:47:55 +0100
xmlns x schema
You need to stop XML Spy from trying to validate your stylesheet against a
schema. I don't know the product well enough to know why it is trying to do
this, but it's this that is causing the trouble. 

After adding the namespace declaration to your stylesheet, you need to refer
to the dt_application element as src:dt_application.

Michael Kay

> -----Original Message-----
> From: Wright, Warren [mailto:Warren.Wright@xxxxxxxxxxxxxxxxxx] 
> Sent: 21 July 2004 00:39
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  x-schema in source xml causing no matches...
> 
> Hi list,
> 
> The xml I am trying to transform has an xmlns declaration that has
> "x-schema:" in it, as shown below.  When I try to transform 
> it, I don't
> match on any of the elements that are within that 
> "x-schema:..." namespace.
> 
> I tried fixing this by adding
> xmlns:src="x-schema:http://www.qa.dealertrack.com/schemas/dtap
> p_v2_0.xdr" to
> the stylesheet, but when I do this xml spy complains that my 
> xslt is no
> longer valid.  Specifically, it tells me "This file is not valid: Root
> element of document 'filename.xslt' is either not defined in 
> DTD/Schema
> document or part of the wrong Namespace".
> 
> See below for the xml and xslt that shows this problem:
> 
> The xml my customer sends looks something like this 
> (abbreviated version):
> 
> <root>
>     <Scorex_Header>
>         <Call_Number>4</Call_Number>
>     </Scorex_Header>
>     <dt_application active="yes" status="new" dtversion="2.0"
> xmlns="x-schema:http://www.qa.dealertrack.com/schemas/dtapp_v2_0.xdr">
>         <key_data optout="no">
>             <dt_lender_id>ETR</dt_lender_id>
>         </key_data>
>     </dt_application>
> </root>
> 
> My XSLT looks like this (abbreviated):
> 
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <xsl:output method="xml" version="1.0" encoding="UTF-8" 
> indent="yes"/>
>     <xsl:template match="root">
>         <root>
>             <xsl:apply-templates/>
>         </root>
>     </xsl:template>
>     <xsl:template match="dt_application" name="dtApplication">
>         <dt_application>
>             <xsl:element name="active">
>                 <xsl:value-of select="@active"/>
>             </xsl:element>
>                 <xsl:apply-templates/>
>         </dt_application>
>     </xsl:template>
> </xsl:stylesheet>
> 
> Assume that the given dt_application section of the input xml 
> really is
> valid according to the dtapp_v2_0.xdr...it isn't in the samples above
> because I abbreviated the xml for purposes of making the 
> email look cleaner.
> 
> Somehow, when the xml fragment doesn't match the xdr the xslt 
> engine ignores
> the namespace, and my xslt works completely, but in the true 
> xml I receive
> the dt_application section DOES match the xdr, and so my xslt 
> doesn't match
> on any of the elements within the dt_application section.
> 
> Thanks for any help!
> 
> Warren Wright

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.