[xml] Re-use code or roll my own?

I read through the relaxng implementation in libxml2 yesterday, and it has a couple of things I'd like to use, but hides them away. And I'm not sure if all I need is readily available either. If I could get some pointers here, that might speed up my work immensely.

The purpose of the relaxng code is to validate a document, but that's not really what I want to do. I want to be able to read the schema into a format where I can use it to decide whether it's possible to dynamically add a certain node into the document at some place - I don't want to validate thee whole thing, I want a list of potential sub-nodes that I can add to a given node. So, given a node in the document, I'd like to get the list of potential nodes I could add.

Additionally, I'd like the same thing for a node and it's attributes: A list of all the attributes a node could have, and their data types.

Daniel, maybe you could estimate that since you're the author of this code: Do you think I'll be faster trying to understand your code and turn it into what I want, or writing my own code?

PS: Yes, this is of course something I want to use for an editor. And yes, I'm fairly new to schemas. But RelaxNG looks really nice - just what I was looking for.
The difference between a Miracle and a Fact is exactly the difference
between a mermaid and a seal.
                -- Mark Twain

Attachment: pgpFqn9gjVoMV.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]