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] XML-aware programming language?

[ Lists Home | Date Index | Thread Index ]

Burak Emir wrote:

> My hypothesis is that anybody who can come up with an instance that uses 
> namespace prefixes in content (or generate it), can also come up with an 
> instance that is sane. (For generated XML, we are talking about the 
> programmers of the generators). For them, it is easy. There is no 
> one-fits-all sanitization for prefixes in content (or rather: qnames in 
> content).


OK. Lets say that we have content that uses two namespaces. Content can 
be edited through a CMS schema validating edit tool and uses a 
proprietary schema and proprietary namespace as well as XHTML's 
namespace. The schema for content pieces is basically XHTML, minus DIV 
and SPAN and all structural elements. The schema includes miscellaneous 
elements in the proprietary namespace. (Multiple content pieces can be 
assigned to a 'page' in defined regions.)

When the page needs to be transformed to (X)HTML, you could do identity 
transforms on the elements in the XHTML namespace. When transforming the 
content in the proprietary namesapce you could do something like:

<xsl:template match="c:*">
   <div class="{local-name()}">
     <xsl:apply-templates/>
   </div>
</xsl:template>

<xsl:template match="c:poll">
   <jsp:scriptlet>
     if (doSubmit) {
       submit poll answers...
     }
   </jsp:scriptlet>

   <form>
     <xsl:apply-templates/>
   </form>
</xsl:template>

<etc/>

In other words, I have some of the content in a namespace that can be 
handled easily one way and I have content in another namspace that needs 
to be handled in multiple different ways.

How would you deal with this in a 'sane' way (which I assume means 
getting rid of the namespaces)? Would it be better?

best,
-Rob


> 
> cheers,
> Burak
> 





 

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

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