XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] [Summary] XML is text-only ... why?

Thanks David.  

Here's the stylesheet that now works:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:xs="http://www.w3.org/2001/XMLSchema";
                version="2.0">
 
    <xsl:output method="html"/>

    <xsl:template match="x">
        <html>
            <head>
                <title>Treating a Space as an Integer</title>
            </head>
            <body>
                Value * 2 = <xsl:value-of
select="string-to-codepoints(.) * 2" />
            </body>
        </html>
    </xsl:template>

</xsl:stylesheet>

The output is:

Value * 2 = 64

/Roger



-----Original Message-----
From: David Carlisle [mailto:davidc@nag.co.uk] 
Sent: Friday, September 28, 2007 9:22 AM
To: Costello, Roger L.
Cc: xml-dev@lists.xml.org
Subject: Re: [xml-dev] [Summary] XML is text-only ... why?


> Am I doing something wrong?

yes, using the function xs:integer to try to get the integer 32 from a
character with unicode value 32. The function you are looking for is
available in xpath but not called xs:integer it is called
string-to-codepoints which returns (in general) a sequence of integers,
but if as here your string has length 1, you'll get a single integer
(32).


David

_______________________________________________________________________
_
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
_______________________________________________________________________
_


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS