Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

documentation.getContent() #10

Closed
Tim-W opened this issue Aug 23, 2019 · 2 comments
Closed

documentation.getContent() #10

Tim-W opened this issue Aug 23, 2019 · 2 comments

Comments

@Tim-W
Copy link

Tim-W commented Aug 23, 2019

Hi, I am not sure if this is a bug or if this is supposed to be cleaned out when parsing the XSD.

When calling element.getAnnotation().getDocumentations(), and the documentations are defined as follows:

	<xs:element name="someElement">
		<xs:annotation>
			<xs:documentation><![CDATA[
			CDATA line 1
			CDATA line 2
			]]></xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:pattern value="[0-9]{9}"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>

Then each documentation.getContent() call returns an empty string. Is this a bug in the code or should I try to find a workaround for my perhaps too specific usecase?

@lcduarte
Copy link
Member

lcduarte commented Aug 24, 2019

Hello Tim,

Thanks for your issue. The problem in your case was that the contents of the documentation tag weren't exactly a text node, but a CDATA node, which I wasn't taking in consideration.

A new release was performed, 1.0.20, and now you have the CDATA contents in the documentation.getContent() call.

Check that out and if it's all cool close this issue :)

@Tim-W
Copy link
Author

Tim-W commented Aug 28, 2019

Thank you 👍

@Tim-W Tim-W closed this as completed Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants