question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DTD elements are not formatted

See original GitHub issue

Following up on #90, given:

<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
    <!ELEMENT to (#PCDATA)>
        <!ELEMENT from (#PCDATA)>
                <!ELEMENT heading (#PCDATA)>
            <!ELEMENT body (#PCDATA)>
]>
<note>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend</body>
</note>

Formatting the document ignores the DOCTYPE content.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
angelozerrcommented, Nov 26, 2018

@NikolasKomonen I think you can work on this formatting issue now. Now you have 3 new structures:

  • DTDElementDecl for <!ELEMENT
  • DTDAttrList for <!ATTRIBUTES
  • DOMEntity for <!ENTITY

That you can see in the outline. Now you can use it for format. Don’t hesitate to update it to improve it according your need for format.

1reaction
angelozerrcommented, Nov 14, 2018

I just want to be sure, the parser should also cover this, eg: <!ELEMENT foo (#PCDATA)> for doctypes?

For my issue with XML completion based on DTD, I don’t need this feature. Me I need to get public, system uri. In otherwords, implement:

My first goal is to support external DTD. I will see after how to support internal DTD (DTD declared in the XML)

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the right formatting of DTD when an Element can both ...
What is the right formatting of DTD when an Element can both contain PCDATA and an ... It is not uncommon to see...
Read more >
DTD Formats
The Client Message Box Request DTD describes the format of the XML document that is used to prompt: (a) a user to respond...
Read more >
Using XML to format definitions - IBM
The contents of all your tags within the document, including tag names and elements, are not case sensitive. The Document Type Definition (DTD)...
Read more >
XML Document Type Definition (DTD) - Library of Congress
An XML Document Type Definition is a formal expression (in XML) of the structural constraints for a class of XML documents. The DTD...
Read more >
XML DTD - W3Schools
DTD stands for Document Type Definition. A DTD defines the structure and the legal elements and attributes of an XML document. Valid XML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found