Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incorrect line number returned when xml element spans multiple lines #70

Open
fausto-m opened this issue Aug 23, 2022 · 0 comments
Open

Comments

@fausto-m
Copy link

When the xml source contains elements where the start tag spans multiple lines, xmldoc gets lost in the line count.

For example:

<Root_Element>
	<Element_1 property_1="property_value" property_2="property_value"
		property_3="property_value">
		<Element_2>
			<Element_3 property_1="property_value"/>
			<Element_4 property_1="property_value"/>
		</Element_2>
	</Element_1>
</Root_Element>

In this case, xmldoc returns 3 as the line for <Element_2>. I was expecting it to return line 4.

Another example:

<Root_Element>
	<Element_1 property_1="property_value" 
		property_2="property_value"
		property_3="property_value">
		<Element_2>
			<Element_3 property_1="property_value"/>
			<Element_4 property_1="property_value"/>
		</Element_2>
	</Element_1>
</Root_Element>

Yet again, line 3 is returned for <Element_2>. I was expecting it to return line 5.

The root cause is sax. I replaced sax by saxes in a local install to test this use case specifically, and saxes returns the correct line number for the elements.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant