RE: [xsl] Another lookup problem (well-formed vs. valid)

Subject: RE: [xsl] Another lookup problem (well-formed vs. valid)
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Tue, 13 May 2003 16:08:54 -0400
[Chris Loschen]

> I've been working with data that conforms to a DTD supplied by
> my client, Now, they have asked that I use some data from an
> additional source which does not conform with their DTD, though
> it is parallel (I think) in that the IDs assigned for each entry
> are equivalent.
> I'm thinking I could use document('....') to pull in the other data,
> and I could use <xsl:key> to access the data, but I'm concerned
> that the other data doesn't conform to the same DTD as the rest.
> I hope (not yet proven) that the other data source is at least well-
> formed -- my validating parser hasn't shown me any well-formedness
> errors. 

It does not matter what dtd the second document conforms to as long as
you know what its structure is so you can write correct templates for
it.  The only thing would be if its dtd refers to URLs or files that are
not accessible to you (because they are on someone else's file system).

>(By the way, this is off-topic, but does anybody happen to
> know how I can just call a non-validating parser to confirm that a
> document is well-formed? 

Well, you do not have to do anything - when you try to run a transform
on it the processor will first parse it, and give you an error if it is
not well-formed.

> One more complication: the additional source document is in 27 pieces,
> so I was combining them using the internal subset on the DOCTYPE
> line, like so:
> <!DOCTYPE OPR PUBLIC "-//xxx/DTD xxx//" "Oro-v315.dtd" [
> <!ENTITY efa SYSTEM "./ef/xmlout/efa.xml">
> ...]
>  >
> &efa;
> ...
> An old SGML trick which is still very handy, but here I'm concerned
> that I'm no longer in pure well-formedness once I've put that DOCTYPE
> line in there. But I don't have access to the internal subset 
> if I don't
> have the DOCTYPE line. I suppose I could hardwire the concatenation
> together if I have to.

document() expects to bring an an xml file, which gets parsed as the
first step.  Normally it would not get validated, but entities declared
in the internal subset ought to be understood as for any other xml file.
Of course you would want to try it out with _your__ system and


Tom P

 XSL-List info and archive:

Current Thread