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

Re: SAX-ext Attribute + Entity Parsing

  • From: Eric van der Vlist <vdv@d...>
  • To: Justin Couch <justin@v...>
  • Date: Wed, 28 Feb 2001 08:34:56 +0100

justin couch
Justin,

Justin Couch wrote:

<.../...> 
> This is what I want to do:
> 
> To create a class that represents both the SAI field interface and the
> DOM attribute I need to provide some mapping service between the name
> and
> the class type. To do this, I've registered myself as a SAX2
> DeclHandler. In this, I have two methods:
> 
>     public void attributeDecl(String element,
>                               String name,
>                               String type,
>                               String defValue,
>                               String value)
> 
Instead of adding methods to the SAX2 classes, have you considered using
the existing ones to pass additional elements/attributes from a specific
namespace to the applications using the existing ones ?

In this case, you would use instead a startElement with a namespaceURI
set to this namespace, a localName set to "attributeDecl" and attributes
containing the name, type, defValue and value.

The applications would then see this as an element:

<xxx:attributeDecl name="..." type="..." defValue="..." value="..."/>

The main benefit from this method is that the additional information
gathered from your documents are passed to the applications using a
common and "standard" API and that you don't need to modify the layer
between these applications and the SAX parser to get them.

For instance, you can directly apply a XSLT transformation on your
documents using this parser and access to the attribute declaration with
XPath. 

I have described a similar application in August last year:
http://www.xml.com/pub/a/2000/08/09/xslt/xslt.html

Hope this helps.

Eric
> --
> Justin Couch                                    Author, Java Hacker
> http://www.vlc.com.au/~justin/               Java 3D FAQ Maintainer
> http://www.j3d.org/              J3D.org The Java 3D Community Site
> -------------------------------------------------------------------
> "Humanism is dead. Animals think, feel; so do machines now.
> Neither man nor woman is the measure of all things. Every organism
> processes data according to its domain, its environment; you, with
> all your brains, would be useless in a mouse's universe..."
>                                               - Greg Bear, Slant
> -------------------------------------------------------------------
> 
-- 
See you in Austin (Knowledge Technologies 2001)
              http://www.gca.org/attend/2001_conferences/kt_2001/mon.htm
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
------------------------------------------------------------------------

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.