Ankur -- The specification says that you might need whitespace where the expression is ambiguous because the minus sign could legally be interpreted as part of a name. An XML element name, however, is defined in the XML spec, production 5, and cannot start with a "-" character. Therefore, -1CRMG0_-CAPGEN_OBJECT01 cannot possibly be an element name and so the leading "-" is interpreted as a the unary negation operator.
HTH, Gary > -----Original Message----- > From: Saigal, Ankur [mailto:[EMAIL PROTECTED] > Sent: Friday, December 28, 2001 2:10 AM > To: [EMAIL PROTECTED] > Subject: "-" in tag name - PROBLEM with XALAN > > > Hi All, > I am an XSL which looks like this, > > <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:MB="urn:sap.com:CRM-Middleware:MapBox" version="1.0"> > <xsl:template match="/"> <xsl:element name="MB:Root"> > <xsl:copy-of select="//MB:RECEPIENTS/"/> > <xsl:element name = "MB:MESSAGE"> > <xsl:element name="tchunk"> > <xsl:attribute name="name">BUPA</xsl:attribute> > <xsl:element name="row"> > <xsl:attribute name="s">I</xsl:attribute> > <xsl:attribute > name="NAME"><xsl:value-of > select="//CAPGEN_OBJECT/-1CRMG0_-CAPGEN_OBJECT01/NAME1/"/></xs > l:attribute> > <xsl:attribute > name="CUSTNO"><xsl:value-of > select="//CAPGEN_OBJECT/-1CRMG0_-CAPGEN_OBJECT01/KUNNR/"/></xs > l:attribute> > <xsl:attribute > name="STREET"><xsl:value-of > select="//BPADDRESS_OBJECT/_-1CRMG0_-BPADDRESS_OBJECT01/STREET > /"/></xsl:attr > ibute> > <xsl:attribute name="ZIPCODE"><xsl:value-of > select="//BPADDRESS_OBJECT/_-1CRMG0_-BPADDRESS_OBJECT01/POST_C > ODE1/"/></xsl: > attribute> > <xsl:attribute > name="CITY"><xsl:value-of > select="//BPADDRESS_OBJECT/_-1CRMG0_-BPADDRESS_OBJECT01/CITY1/ > "/></xsl:attri > bute> > <xsl:attribute > name="PHONE"><xsl:value-of > select="//BPPHONE_OBJECT/_-1CRMG0_-BPPHONE_OBJECT01/TEL_NUMBER > /"/></xsl:attr > ibute> > <xsl:attribute > name="FAX"><xsl:value-of > select="//BPFAX_OBJECT/_-1CRMG0_-BPFAX_OBJECT01/FAX_NUMBER/"/> > </xsl:attribut > e> > </xsl:element> > </xsl:element> > </xsl:element> > </xsl:element> > </xsl:template> > <xsl:template name="CAPGEN_OBJECT"> > > </xsl:transform> > > > While processing this XALAN gives me an error, saying " > javax.xml.transform.TransformerConfigurationException: > 1CRMG0_-CAPGEN_OBJECT01 could not be formatted to a number! " > This means that it takes the "-" sign before this as > substraction operator and tries to convert > 1CRMG0_-CAPGEN_OBJECT01 into a number. To my understanding, > the specification says that "-" shuould be considered > substraction operand only when it is succeeded by a space. Is > there any solution to this problem, some work around? > > Thanks and Regards, > Ankur >
