|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Need help to flatten and regroup data
> -----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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








