AussieSilver
asked on
convert the lower case to upper case
Hi Guys,
If you have a look at the attached code... the xslt reads attributes "from" and "to" from the source document. in the source document, they are in lower-case. I want them be written in the results document in an upper case. Please look at my code where I have tried but it did not work where it gives me the following error:
******
SXXP0003: Error reported by XML parser: Element type "xsl:value-of" must be followed by
either attribute specifications, ">" or "/>".
Failed to compile stylesheet. 1 error detected.
If you have a look at the attached code... the xslt reads attributes "from" and "to" from the source document. in the source document, they are in lower-case. I want them be written in the results document in an upper case. Please look at my code where I have tried but it did not work where it gives me the following error:
******
SXXP0003: Error reported by XML parser: Element type "xsl:value-of" must be followed by
either attribute specifications, ">" or "/>".
Failed to compile stylesheet. 1 error detected.
<from><xsl:value-of select="translate("@from", $smallcase, $uppercase)"/></from>
<to><xsl:value-of select="translate("@to", $smallcase, $uppercase)"/></to>
remove the double quotes from the attributes @from and @to
<from><xsl:value-of select="translate(@from, $smallcase, $uppercase)"/></from>
<to><xsl:value-of select="translate(@to, $smallcase, $uppercase)"/></to>
<from><xsl:value-of select="translate(@from, $smallcase, $uppercase)"/></from>
<to><xsl:value-of select="translate(@to, $smallcase, $uppercase)"/></to>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i think its causing due to the imbalance in the double quotes,
Pls refer the snippet
Hope this helps
Pls refer the snippet
Hope this helps
<from><xsl:value-of select="translate(@from, $smallcase, $uppercase)"/></from>
<to><xsl:value-of select="translate(@to, $smallcase, $uppercase)"/></to>
ASKER
YOU ARE THE BEST !!!!
ASKER
Sorry shinug
I should have declared the $smallcase and $uppercase....
I should have declared the $smallcase and $uppercase....
Note that:
- in XPath functions and expressions, you don't need to put quotes (or single quotes) around the XPath. It will be evaluated as a string, in this case you don't want the string "@from" in the translate(); you want the attribute from
- strings in double-quote delimited attribute values should be seperated by single -quotes, to keep the balance right
- the translate function is a work-around for uppercasing in this example, but you will need every character in the uppercase, explicitely mentuioned in a variable, which I added for you
- in XPath functions and expressions, you don't need to put quotes (or single quotes) around the XPath. It will be evaluated as a string, in this case you don't want the string "@from" in the translate(); you want the attribute from
- strings in double-quote delimited attribute values should be seperated by single -quotes, to keep the balance right
- the translate function is a work-around for uppercasing in this example, but you will need every character in the uppercase, explicitely mentuioned in a variable, which I added for you
welcome
ASKER
GREAT... thanks very much Gertone... I wish i give you 1000000 points
ASKER
Open in new window