Coder Social home page Coder Social logo

Comments (8)

Delagen avatar Delagen commented on July 18, 2024

I think processing instructions not covered yet

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

Sorry for the late response. It is a festive season here. As @Delagen said, it is not covered yet. It's a very small change. I'll publish the changes on Monday.

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

Please use 3.4.0

from fast-xml-parser.

keponk avatar keponk commented on July 18, 2024

@amitguptagwl i can't find a reference on how to access the processing instructions. Is it correct to say that only the validator is aware of it? I would like to access the processing instructions after validation as well, they contain valuable info.

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

Validator is checking for valid syntax of PI. And parser is ignoring them to read. Can you please tell me some use case where you feel you want keep their data and the desire format of the data. We can plan to include it into v4.

from fast-xml-parser.

keponk avatar keponk commented on July 18, 2024

@amitguptagwl thanks for the quick reply. PI's do have a dedicated purpose, normally it is a connection between XML authors and the xml-aware application [1].

My use case is that I receive an XML from someone else. This author decided to use PI's to embed metadata of the XML. One could argue that the purpose of PIs is not related to metadata and the author could've chosen to embed that metadata in a real tag, but this is where we are and technically the author is complying with the XML standard.

Further, it seems to me that a parser reading a valid xml should return to me all the information in there, including the PI, which is part of XML standard. Sadly, as XML popularity declines it seems to me there are not many robust parsers out there who do take PIs into account as it may be more of an obscure use case in 2020, I've only found hobby parser projects that do keep PI's in the JSON output.

Regarding the desired format, I think continuing with fast-xml-parser standard would be best, that is, in similarity to using the attr keyword, the PIs could be packed as an array with a relevant keyword such as instr. They should follow the same nesting rules as attr if possible.

Let me know if this makes sense or if I can provide more specific examples.

[1] https://docstore.mik.ua/orelly/xml/xmlnut/ch17_02.htm

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

I have created another issue to track it

from fast-xml-parser.

amitguptagwl avatar amitguptagwl commented on July 18, 2024

Please check v4.0.0-beta.6

from fast-xml-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.