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

dynamic elements

  • To: XML-Dev <xml-dev@l...>
  • Subject: dynamic elements
  • From: James William Pye <flaw@r...>
  • Date: Mon, 25 Oct 2004 11:03:51 -0700
  • Organization: rhid development

dynamic elements
Greets,

Developing an XML extension that provides custom sources of entity
declarations seems impossible without a version bump, so I have tried to
work out a solution to provide the same functionality with minimal
impact.

An obvious solution would be to reserve another character denoting
"variable expansion", but I feel that that is rather intrusive, and
perhaps unnecessary.

So, I believe the best solution might be to use element syntax and
namespaces to provide a mechanism to identify 'dynamic elements'. Of
course, the element syntax won't work(nicely) in attributes, so a
special construct would need to be developed to handle that
context(S-Exp like, I figure).

Without further ado, a simple example illustrating the idea:

<xml xmlns="fake"
 xmlns:de="http://rhid.com/~xml/de/0"
 xmlns:char="$(de:src[type='text/xml' href='/iri/to/defs.xml'])">
<!--
 The feature/extension should be enabled by a processor as soon as it
 assigns/binds the http://rhid.com/~xml/de/0 namespace.

 The char namespace is effectively a "blessed" namespace with regards
 to it being a source for dynamic elements. This is how a processor will
 identify elements that need to be evaluated for the production(final
 document).
 
 The char namespace also displays a sort of compact element
 syntax(resembles S-expressions, but with a $ denoting elements).
 de:src being the qualified name, and the optional square brackets
 denoting attributes and everything else that follows is the element
 content(in this case, an empty "element").
 !-->

 <char:amp/>
 <char:lt/>
 <!--
  This works out nicely, I think. It provides entity functionality with
  namespaces, which I find quite attractive, and very interesting.
  !-->
</xml>

This extension is a bit more interesting than entity functionality, as
an extension like this would provide a general framework for XML
functions. Processors would provide the custom source implementations
with the input of the "function"; the input being the contents and/or
the attributes of the dynamic element.

Thinking about it, this seems like a fairly obvious direction. Has this
been explored before(or similar area, save XInclude)? If so, URLs on the
articles/discussions?

(I'm not too sure I like using the term 'dynamic elements' or 'XML
functions', but it seems relatively appropriate, so...)

Comments, criticisms?

-- 
Regards,
        James William Pye

This is a digitally signed message part


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.