OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] RE: description of the logical or semantic structure

[ Lists Home | Date Index | Thread Index ]
  • To: Michael Kay <mike@saxonica.com>
  • Subject: Re: [xml-dev] RE: description of the logical or semantic structure
  • From: Philippe Poulard <Philippe.Poulard@sophia.inria.fr>
  • Date: Wed, 02 Nov 2005 17:23:48 +0100
  • Cc: "'ludger goeke'" <ludgergoeke@gmx.de>, xml-dev@lists.xml.org
  • In-reply-to: <200511021504.jA2F4jvZ004383@sophia.inria.fr>
  • References: <200511021504.jA2F4jvZ004383@sophia.inria.fr>
  • User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050511

Michael Kay wrote:
>>   <Name>Peter Smith</Name>
>>   <Age>56</Age>
>>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"?>
     <Name>Peter Smith</Name>

------------- decoder.xsl :
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
         <cn:ennemy>North Korea</cn:ennemy>
         <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>

     <xsl:strip-space elements="*"/>

     <xsl:template match="/">

     <xsl:template match="*">
         <xsl:variable name="alternate">
                 <xsl:when test="contains( name(), 'm' )"><xsl:text> 
         <xsl:value-of select="translate( name(), 'emnNoPrs', concat( 
$alternate, 'nh cLun' ) )"/>

     <xsl:template match="Age">
         <xsl:text> </xsl:text>

     <xsl:template match="text()">
         <xsl:variable name="alternate">
             <xsl:value-of select="translate( ., ' eimPrS', 'kanoac ' )"/>
                 <xsl:when test="substring( $alternate, 2, 1) = 'a'">
                     <xsl:value-of select="substring( $alternate, 1, 1)"/>
                     <xsl:value-of select="substring( $alternate, 3, 7)"/>
                     <xsl:text> </xsl:text>
                     <xsl:value-of select="$alternate"/>



           (. .)
|   Philippe Poulard    |


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

Copyright 2001 XML.org. This site is hosted by OASIS