Skip to content

StAXEncoder.writeAttribute() putting attributes on wrong element? #43

@jsbiff

Description

@jsbiff

In the following code, if xmlw is a normal StAX XMLStreamWriter object, the xhtml comes out correctly, that is, with the "rel" and "href" attributes attached to the "link" element:

       xmlw.writeStartElement("head");
	xmlw.writeEmptyElement("link");
	xmlw.writeAttribute("rel", "stylesheet");
	xmlw.writeAttribute("href", "css/xmlwriter01.css");
	xmlw.writeStartElement("title");
	xmlw.writeCharacters(title);
	xmlw.writeEndElement();
	xmlw.writeEndElement();

I ran this program (there's more to it - like setting encoding and fidelity options on the factory object - including the option EncodingOptions.INCLUDE_OPTIONS so that the resulting Exi file would have the options needed to decode it) , again, but this time I had xmlw setup as a StAXEncoder object, to write out the xhtml as an exi file.

I then used the exificient-gui program to decode to an XML file, and what I discovered is that the two attributes that should have been on the "link" element, ended up on the element AFTER the link element (which was a "title" element).

I think this might be a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions