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

Xpath/XSLT 2.0 & Schema Question

Subject: Xpath/XSLT 2.0 & Schema Question
From: Luke Stedman <luke.stedman@xxxxxxxxx>
Date: Thu, 1 Apr 2010 16:58:50 +0100
 Xpath/XSLT 2.0 & Schema Question
Apologies in advance for what is probably a very simple/basic/stupid

I have just started using XSL 2.0, having had enough of the
restrictions of XSL 1.0, and am trying to write a XSL that is schema

I would like to process an XML file and add information/process
something based on the schema, for example adding class information to
XML output or processing an element in a specific way if we want a
console script or Python script output.

I have tried for the last couple of hours to get the code working but
seem to be unable to, a small snippet of code is below...

  <xsl:template match="*[@name and @xsi:type]">
   <xsl:copy-of select="@*"/>
   <xsl:attribute name="action" select="'new'"/>
   <xsl:variable name="name" select="name(.)"/>
   <xsl:variable name="type" select="current()/@xsi:type"/>
   <xsl:variable name="object" select="element(*, $type)"/> <!-- I
want to get the relevant schema entry here -->
    <xsl:value-of select="current()/@name"/>
    <xsl:variable name="type" select="current()/@xsi:type"/>
    <xsl:value-of select="$object//base"/>

Am I misunderstanding the functionality or doing something wrong?

If I have missed a relevant post on the list or obvious link then
please point me in its direction, I was unable to find one using a

Apologies again for any stupid comments/expectations.

Current Thread


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.
First Name
Last Name
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.