Hi all, I'm trying to select an attribute called xmi:id in an xslt. <xsl:value-of select="@xmi:d"/> but won't work with ':' in the select. Would someone be bale to help me out? Also, are these known as special characters? Thanks, C
What exactly the problem is? Don't forget to decalre xml namespace: <xsl:value-of select="@xmi:d" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> -- Oleg conorgaff@gmail.com wrote: > Hi all, > > I'm trying to select an attribute called xmi:id in an xslt. > > <xsl:value-of select="@xmi:d"/> > > but won't work with ':' in the select. > > Would someone be bale to help me out? > > Also, are these known as special characters? > > > Thanks, > > C
On Feb 7, 10:08 pm, Oleg Tkachenko wrote: > What exactly the problem is? > Don't forget to decalre xml namespace: > <xsl:value-of select="@xmi:d" > xmlns:xml="http://www.w3.org/XML/1998/namespace"/> > -- > Oleg > > conorg...@gmail.com wrote: > > Hi all, > > > I'm trying to select an attribute called xmi:id in an xslt. > > > <xsl:value-of select="@xmi:d"/> > > > but won't work with ':' in the select. > > > Would someone be bale to help me out? > > > Also, are these known as special characters? > > > Thanks, > > > C Hi Oleg, When I try to declare the name space I and do the transform I get the error: ERROR: Namespace prefix xmi has not been declared Is this not included in the beginning where I started with: xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform" xmlns:dyn="http://exslt.org/dynamic".... <xsl:output method = "xml" encoding = "iso-8859-1" indent="yes" /> Thanks for your help, C
conorgaff@gmail.com wrote: > I'm trying to select an attribute called xmi:id in an xslt. > > <xsl:value-of select="@xmi:d"/> > > but won't work with ':' in the select. You need to bind the prefix 'xmi' to a namespace URI by declaring e.g. <xsl:stylesheet xmlns:xmi="http://example.org/ex1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> Of course you need a different namespace URI than given in my example but the right URI obviously depends on your XML input. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/
On Feb 8, 12:26 pm, Martin Honnen wrote: > conorg...@gmail.com wrote: > > I'm trying to select an attribute called xmi:id in an xslt. > > > <xsl:value-of select="@xmi:d"/> > > > but won't work with ':' in the select. > > You need to bind the prefix 'xmi' to a namespace URI by declaring e.g. > <xsl:stylesheet > xmlns:xmi="http://example.org/ex1" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > > Of course you need a different namespace URI than given in my example > but the right URI obviously depends on your XML input. > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/ This did the trick xmlns:xmi="http://www.omg.org/XMI" Thanks