commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33780] New: - [betwixt] SAX Attribute Problem: qName differ from localName
Date Mon, 28 Feb 2005 23:43:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33780>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33780

           Summary: [betwixt] SAX Attribute Problem: qName differ from
                    localName
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Betwixt
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: cgaffga@triplemind.com


hi,

I found a problem with the output of attributes to SAX events. When I write a
simple bean like that:

public class SimpleClass {
    private String testPropertyOne = "abc";
    private Integer testPropertyTwo = new Integer(12);
    public String getTestPropertyOne() { return testPropertyOne; }
    public Integer getTestPropertyTwo() { return testPropertyTwo; }
}

with a dot-betwixt-file like that:

<?xml version="1.0" encoding="ISO-8859-1"?>
<info primitiveTypes="element">
    <element name="test-class">
        <attribute name="test-prop-1" property="testPropertyOne"/>
        <attribute name="test-prop-2" property="testPropertyTwo"/>
    </element>
</info>

to a SAX stream, I recognized that the attribute qualified names differ from the
local names. This causes strange effects when using betwixt with other software.
In my case I can't use it with cocoon and the BetwixtTransformer.

I will attach a small test case as a patch to this bug report. I would expect to
have the following output to STDOUT from that test:

XML: start document event
XML: start element qName 'test-class', localName 'test-class', URI:
     - Attribute qName 'test-prop-1', localName 'test-prop-1' of CDATA: abc
     - Attribute qName 'test-prop-2', localName 'test-prop-2' of CDATA: 12
     - Attribute qName 'id', localName 'id' of ID: 1
XML: end element 'test-class'
XML: end document event

but the output I got is:

XML: start document event
XML: start element qName 'test-class', localName 'test-class', URI:
     - Attribute qName 'test-prop-1', localName 'testPropertyOne' of CDATA: abc

then the test breaks in assertEquals(qName, localName) because they are not equal.
I tried to figure out what causes the attributes to differ, but I'm not so
familiar with betwixt to figure it out. Maybe somebody has an Idea and could fix it.

For my usecase I can use a wrapper class for the SAX content handler that
catches these attributes and fixes the localNames to be identical with the
qNames. But it's only a workaround.

regards,
Christoph Gaffga


P.S.: The the TestCase attached to this bug report  as a patch.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message