-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Self-closing tag is a non-text node whereas empty tag is a text node #18
Comments
I'll be back to code from coming Monday. So will check the issue in few
days.
Thanks for raising the issue.
…On 19-Jul-2017 7:17 AM, "Gene Expression Atlas" ***@***.***> wrote:
<tag id="foo"/> and <tag id="foo"></tag> are treated differently. To
parse the attributes in the first case you need to specify ignoreNonTextAttr:
false and for the second case ignoreTextAttr:false. Also, the second tag
will have a #text field and the first one won’t. I think this behaviour
doesn’t match the XML spec <https://www.w3.org/TR/REC-xml/#sec-starttags>,
as the two should be equivalent:
Empty-element tags may be used for any element which has no content,
whether or not it is declared using the keyword EMPTY. For
interoperability, the empty-element tag SHOULD be used, and SHOULD only be
used, for elements which are declared EMPTY.
Examples of empty elements:
<IMG align="left"
src="http://www.w3.org/Icons/WWW/w3c_home" />
<br></br>
<br/>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHVgKLDC_moed_Dh9OpajIEtTQBpmjsRks5sPWA5gaJpZM4OcIOZ>
.
|
@gxa Though the both tags should be treated equally, in the parser user can decide weather he wants to ignore attributes of one type or of both type. So if many users of parser library feel that I should make it one, I'll do that.
Let me know if you have any other doubt. |
Please raise the other issue if you still have any doubt. |
<tag id="foo"/>
and<tag id="foo"></tag>
are treated differently. To parse the attributes in the first case you need to specifyignoreNonTextAttr: false
and for the second caseignoreTextAttr:false
. Also, the second tag will have a#text
field and the first one won’t. I think this behaviour doesn’t match the XML spec, as the two should be equivalent:The text was updated successfully, but these errors were encountered: