[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML-aware programming language?


burak emir
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
> 


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.