[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to give an attribute a QName value, with the
At 2012-08-27 20:37 +0000, Costello, Roger L. wrote:
Hi Folks, Retrieve it from the namespace axis: (untested; assumes the default namespace is not the XSD namespace) <xsl:attribute name="{name(namespace::*[.='http://www.w3.org/2001/XMLSchema'])]}:anySimpleType" namespace="http://www.w3.org/2001/XMLSchema"> <xsl:copy-of select="node()"/> </xsl:attribute> or in XSLT 2.0: (untested) <xsl:attribute name="{prefix-from-QName(node-name(.))}:anySimpleType" namespace="http://www.w3.org/2001/XMLSchema"> <xsl:copy-of select="node()"/> </xsl:attribute> Remember that node-name(.) gives the QName of the name of the current node, not the name string of the name of the current node. I hope this helps. . . . . . . . . . Ken -- Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012 Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|