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

RE: Need help to flatten and regroup data

Subject: RE: Need help to flatten and regroup data
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Mon, 24 May 2004 20:19:05 +0200
flatten help
> -----Original Message-----
> From: Yang, Siew-Hong [mailto:siew-hong.yang@xxxxxx]
>

Hi,

<snip what="source + target XML description" />
>
> I flatten the data but then I could not get anything else going. In
> particular, I could not make XSLT to use template that tries to match
> anything NOT in the "ns:" nodes. Examples, I could not get <template
> match="//Node"> or  <template match="//metric">to work....
>
> I declared the namespaces at the beginning of the style sheet.
>

Can you show us a bit more of the source document? Is it perhaps using
another namespace for the nodes without prefix? (And how exactly are the
namespaces defined in your stylesheet...?)

Try if

match="*[local-name()='Node']"

works. If it does, I guess the root node in the source document has
xmlns="_some namespace URI_" (?) If so, bind this namespace to another
prefix on the xsl:stylesheet element, and then use that prefix to select the
nodes that are without prefix in your source XML.

Normally, IIRC, XPath uses no-namespace (not even the default one), unless
explicitly asked to take this into account by specifying it like:

match="*[namespace-uri()='_some namespace URI_']"

or by matching nodes to their fully qualified name (incl. namespace prefix,
and that is, the prefix to which the namespace is bound in your
xsl:stylesheet element), or by doing something more ugly like:
starts-with(name(),'ns:') ('ugly' because of the dependency of this piece of
code on the namespace being bound to *that* particular prefix)


HTH!

Greetz,

Andreas

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.