 |
 |
 |
Michael Kay wrote:
>><Person>
>> <Name>Peter Smith</Name>
>> <Age>56</Age>
>></Person>
>>
>>
>>Does the markup describes the content for example "Peter Smith" in a
>>semantic way, that means does it describes that
>>the content "Peter Smith" has the semantic of a name
>
>
> No, the tags in your markup are arbitrary strings. It's your description of
> the markup "When I say Name, I mean personal name" that conveys the
> semantics. There's arguably a default description "When I use a tag that's
> an English word, I use it with the same meaning as that English word", but
> that's still something that's external to the XML document itself. The tags
> have no meaning without an external explanation of their intent and usage.
> Without that explanation, the above XML fragment could mean "Launch an
> attack on Cuba NOW!".
>
> Michael Kay
>
there exists an application that does it exactly like this :)
------------- secret-message.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="decoder.xsl"?>
<Person>
<Name>Peter Smith</Name>
<Age>56</Age>
</Person>
------------- decoder.xsl :
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cn="http://my.ennemies.com"
xmlns:date="http://www.dates.org"
>
<cn:ennemies>
<cn:ennemy>North Korea</cn:ennemy>
<cn:ennemy>France</cn:ennemy>
<cn:ennemy>Irak</cn:ennemy>
<cn:ennemy>Iran</cn:ennemy>
<cn:ennemy>Cuba</cn:ennemy>
</cn:ennemies>
<date:dates>
<date:when>Tomorrow</date:when>
<date:when>Next monday</date:when>
<date:when>At christmas</date:when>
<date:when>The next 14th of july</date:when>
<date:when>Yesterday ?</date:when>
<date:when>NOW!</date:when>
</date:dates>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<html>
<body>
<h1><xsl:apply-templates/></h1>
</body>
</html>
</xsl:template>
<xsl:template match="*">
<xsl:variable name="alternate">
<xsl:choose>
<xsl:when test="contains( name(), 'm' )"><xsl:text>
</xsl:text></xsl:when>
<xsl:otherwise>a</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="translate( name(), 'emnNoPrs', concat(
$alternate, 'nh cLun' ) )"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Age">
<xsl:value-of
select="document('')/*/cn:ennemies/cn:ennemy[number(substring(current(),1,1))]"/>
<xsl:text> </xsl:text>
<xsl:value-of
select="document('')/*/date:dates/date:when[number(substring(current(),2,1))]"/>
</xsl:template>
<xsl:template match="text()">
<xsl:variable name="alternate">
<xsl:value-of select="translate( ., ' eimPrS', 'kanoac ' )"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="substring( $alternate, 2, 1) = 'a'">
<xsl:value-of select="substring( $alternate, 1, 1)"/>
<xsl:text>t</xsl:text>
<xsl:value-of select="substring( $alternate, 3, 7)"/>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$alternate"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
--
Cordialement,
///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |