[ 
https://issues.apache.org/jira/browse/DAFFODIL-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17219349#comment-17219349
 ] 

Mike Beckerle commented on DAFFODIL-2422:
-----------------------------------------

To clarify my prior comment, here are two ways to generate a series of SAX 
ContentHandler calls:

1) Parse data with daffodil to XML text. Save that to a file. Read the file 
with an XML Reader that calls a SAX content handler.

2) Parse data with daffodil calling a SAX content handler.

The series of content handler calls should be equivalent.

I believe that we have identified a difference here because we don't support 
turning ON the "namespace-prefixes" feature. 

The upshot of this is a SAX-based application that depends on startElement 
callback passing it attributes corresponding to the xmlns definitions, ... is 
going to break.

 

I think the key point here is neither we, nor people using Daffodil via APIs, 
are writing these SAX content handlers. Rather we must assume they're just 
getting one already defined in software for which they don't even have source 
code. Whether that software uses or ignores the namespace binding callbacks and 
needs the xmlns attributes isn't up to us, nor to a Daffodil user.

My example would be an EXI-writing content handler. (FYI, the EXI is a denser 
binary form for XML documents.) These are available in at least one commercial 
non-open-source library. Will that work when I connect daffodil parsing SAX API 
to it by using it as the SAX content handler?

Until we try it we simply don't know.

So we can leave this unimplemented for now, but we don't know if this will be 
critical to a primary use case or not.

> Implement  allowed features for DaffodilXMLReader/DaffodilOutputContentHandler
> ------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2422
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2422
>             Project: Daffodil
>          Issue Type: Bug
>          Components: API
>            Reporter: Olabusayo Kilo
>            Priority: Major
>
> The DaffodilXMLReader reader allows you to set/get the 
> Namespace/Namespace-Prefixes features, but it actually doesn't implement them 
> when passing info to a ContentHandler, as is required  by the documentation. 
> Since the XMLReader is expected to work with any ContentHandler, this can 
> lead to unexpected results. We need to update the XMLReader to send the 
> appropriate stuff to the ContentHandler (which within our implementation is 
> via the SAXInfosetOutputter), and to mimic the behavior expected of it in the 
> [XMLReader Documentation 
> title|https://docs.oracle.com/javase/7/docs/api/org/xml/sax/XMLReader.html]
>  
> The table is an excerpt from the [SAX Documentation|#package_description]]
> ||Feature ID||Access||Default||Description||
> |namespaces|_read/write_|true|A value of "true" indicates namespace URIs and 
> unprefixed local names for element and attribute names will be available.|
> |namespace-prefixes|_read/write_|false|A value of "true" indicates that XML 
> qualified names (with prefixes) and attributes (including _xmlns*_ 
> attributes) will be available.|



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to