8000 XmlPrinter: Generated data throws exception: Attribute 'type' redefined. · Issue #4805 · javaparser/javaparser · GitHub
[go: up one dir, main page]

Skip to content

XmlPrinter: Generated data throws exception: Attribute 'type' redefined. #4805

@sgqy

Description

@sgqy

Version: com.github.javaparser:javaparser-symbol-solver-core:3.27.0

Convert java source to xml:

XmlPrinter printer = new XmlPrinter(true);
return printer.output(compileUnit);

Get xml with this part:

<type type="PrimitiveType" type="BOOLEAN">

Use other tool to parse, eg, Python lxml:

lxml.etree.fromstring(ast_xml)

Raise exception:

XMLSyntaxError: Attribute type redefined, ...

Patch #4806 changes type to _type, with a private meaning.

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

      0