Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
The specifications for XML 1.0 are set forth by the World Wide Web Consortium here. These specs state:
Enumerated Attribute Types ... [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ' +)' [VC: Enumeration] ... Examples of attribute-list declarations: ... <!ATTLIST list type (bullets|ordered|glossary) "ordered"> ...
My reading of the XML specifications is that pipes in attribute-list declarations should not have spaces surrounding them.

Similarly, in XML 1.0 one ought not to surround pipes with spaces in element type declarations either:

Examples of element type declarations: ... <!ELEMENT p (#PCDATA|emph)* >

It is unfortunate that attr test contains what may be a malformed XML Document Type Declaration. However, the XML specifications contain no requirements for user-friendly error handling. All an XML parser has to do when encountering bad XML is stop. It need do no more.

Update: Our resident XML guru Mirod has pointed out to me that the S? in the XML rule I quoted means that the pipe can, indeed be surrounded by whitespace. He opines that there is an error, but that it is likely in XML::Parser on which XML::DOM is built.

Mirod points out that according to Rule 3

(see rule 3: S ::= (#x20 | #x9 | #xD | #xA)+ >

Hence, S? means there can be an optional space around the '|'

Moral. I should learn to read XML specs better. Thanks to mirod for correcting this error.

In reply to Re: Weirdness (and bugfix for) XML::DOM ... by sierrathedog04
in thread Weirdness (and bugfix for) XML::DOM ... by deprecated

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2022-09-28 23:23 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (125 votes). Check out past polls.