The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] JDom - Comment data cannot start with a hyphen
Good Afternoon,
I am using xpath to extract information from html documents that have been saved on my PC from a webcrawl.
Everything seems to works OK except occasionally I get the following error
the data "-10" is not legal for a JDOM comment: Comment data cannot start with a hyphen
When inspecting the html I find
<!---10-->
which seems to be causing the problem.
Any ideas of how to get around this?
Many Thanks
Scott
I am using xpath to extract information from html documents that have been saved on my PC from a webcrawl.
Everything seems to works OK except occasionally I get the following error
the data "-10" is not legal for a JDOM comment: Comment data cannot start with a hyphen
When inspecting the html I find
<!---10-->
which seems to be causing the problem.
Any ideas of how to get around this?
Many Thanks
Scott
0
Answers
Removing check that a comment not start with a hyphen. A careful reading
of production 15 in the XML 1.0 spec indicates leading hyphens are in
fact allowed.
taken from http://jdom.markmail.org/message/b45honrv3crcmqux posted 4 years ago.
If this is the case, what does one need to do to solve the problem?
Thanks
S
Any ideas?
Thanks
Scott
I will appreciate your help. thanks
thanks for the hint. At the moment we are using JDom 1.0 but we will update it to the latest library version soon.
Until then you could use the 'Remove documents parts' operator with this regular expression: <!---.*-->
This removes every comment with a hypen at the beginning thus allowing the extract information operator to work correctly.
Regards,
Nils