Re: PIs considered harmful Was: XML-SW, a thought experiment

> Elliotte Rusty Harold wrote:
> > A PI can contain essentially arbitrary XML except for other PIs

That's interesting, I didn't know.  However, I think my original point
still stands.  If you're using PIs to make DC annotations, how would you
"annotate the annotations" so to speak if nested PIs are not permitted?

Eric van der Vlist suggested:
> I'd add that even though current schema languages have chosen to ignore
> PIs and comments, there is no reason why a XML Schema language couldn't
> validate (ie, check that they follow certain patterns and are included
> at certain locations in a document) them if there was a need for such a
> validation.

But wouldn't that completely defeat the original point of the PIs, which
was that they're "outside" the scope of validation?  So what happens if I
now inherit an unmodifiable schema that specifies what PIs are allowed
where -- how do I add the custom new PIs necessary for my application?  I
think we've come full circle.  :-)

My suggestion, though it's probably not practical:  Specify any processing
instructions in your own XML vocabulary in a separate file, linking it to
the original through appropriate XPath expressions.  When processing, you
need to specify the original file and any additional processing
instruction file(s).  A smart parser could probably integrate the
instructions into the primary XML stream on the fly, if desired.

Advantages:  You can validate both the original document and the PI
document, each to their own schema.  Your PIs can take advantage of all
XML features.  A single document can have many sets of PIs for different
purposes, even from the same namespace/vocabulary.

Disadvantages:  Multiple files.  Hand-editing gets ugly/impossible.  Needs
customized parsers to make it transparent.

        -- P.

--
  Piotr Kaminski <piotr@ideanest.com>  http://www.ideanest.com/
  "It's the heart afraid of breaking that never learns to dance."

Received on Saturday, 23 February 2002 18:51:28 UTC