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

RE: Newbie: template match using a mix of namespace pr

Subject: RE: Newbie: template match using a mix of namespace prefix and none p refix
From: Palmer Magnus <Magnus.Palmer@xxxxxxxxxxxx>
Date: Mon, 9 Sep 2002 10:58:01 +0200
userarea oagis
Hi Tennison,

> 1) Absolute path, not working
> <xsl:template
>
match="/msg/req/dta/SHOW_PO_007/DATAAREA/SHOW_PO/POHEADER/of:USERAREA/of:TRA
> NSMETHD" mode="copy">

<<My guess would be that these paths aren't working because the msg,
<<req, dta, SHOW_PO_007, DATAAREA, SHOW_PO and/or POHEADER elements are
<<in a namespace in your XML document. Without seeing your source
<<document I can't tell, but this seems to be the most likely
<<explanation.

The namespaces are as following:
<xsl:stylesheet version="1.0" 
xmlns="x-schema:http://scshost/schemas/oagis/7.1/011_show_po_007.xdr"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:of="x-schema:http://scshost/schemas/oagis/7.1/oagis_fields.xdr" 
xmlns:os="x-schema:http://scshost/schemas/oagis/7.1/oagis_segments.xdr" 
xmlns:scala="x-schema:http://scshost/schemas/oagis/7.1/scala_fields.xdr"
>
Hence I asume that the default namespace is using the 011_show_po_007.xdr
namespace.
These namespaces are declared in the SHOW_PO_007 element of the incoming
source document.

This is a partial trace from Saxon:
</Source><!--
/msg[1]/req[1]/dta[1]/SHOW_PO_007[1]/DATAAREA[1]/SHOW_PO[1]/POHEADER[1]/of:U
SERAREA[1]/text()[8] -->
                                   <Source
node="/msg[1]/req[1]/dta[1]/SHOW_PO_007[1]/DATAAREA[1]/SHOW_PO[1]/POHEADER[1
]/of:USERAREA[1]/of:TRANSMETHD[1]" line="77" mode="*default*">
                                    <Instruction element="xsl:template"
line="20">
                                     <Instruction element="xsl:copy"
line="21">
                                      <Instruction
element="xsl:apply-templates" line="22">
To my understanding (being fairly new to XSL*) Saxon has identified the same
source path as I am using, or?

> 3) This one is working, but now I may match POLINE tags as well...
> <xsl:template match="//of:USERAREA/of:TRANSMETHD" mode="copy">

<<This template will only match of:TRANSMETHD elements that are children
<<of of:USREAREA elements, so I don't understand why you say that it
<<might match POLINE elements as well.

Well this is probably because you haven't seen the source document
structure.
There might be a POHEADER/of:USERAREA/of:TRANSMETHD and several
POLINE[1->n]/of:USERAREA/of:TRANSMETHD

Thanks for clarifying the // :)

Best regards Magnus

 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.