RE: [xsl] Newted XML Documents

Subject: RE: [xsl] Newted XML Documents
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Tue, 22 Apr 2003 12:56:21 -0400
[Jack Cane]
This has nothing to do with xslt, the subject of this list.
> 
> Am having difficulty with the "include" statement in my 
> schema definition
> file.
> 
> First I created the schema using xmlspy. I then manually 
> edited the .xsd
> file and added a line with "&" and the included file (see below).

That is your problem.  Contrary to your statement, you did not have an
"include" statement, rather, you inserted an external parsed entity.  If
you did not declare it in a DTD, then the parser does not know anything
about it and so you get an error.  If you did declare it, the parser
does not actually have to expand the entity (unless the parser is in
validating mode which is unlikely).  If it did expand it, then it is
regarding the contents as text, which is not allowed there.  That might
be an error on Spy's part, but it is irrelevant because there is an
"include" mechanism in xml schema already, and all you have to do is to
use it correctly.

Tom P

> =================
> <xs:schema targetNamespace="http://enw-ltd.com/namespace";
> xmlns="http://enw-ltd.com/namespace";
> xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
> elementFormDefault="qualified"
> attributeFormDefault="unqualified">
>   &trisection.xsd;
>   <xs:element name="foo">
>   <etc....>
> </xs:schema>
> =================
> When I then opened the file in xmlspy, the error sais "unable to show
> schema: Text is unexpected at this location!", and the 
> reference to the
> include statement is highlighted.
> 
> Any ideas appreciated.
> 
> jwc
> 
> 
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of 
> Gregory Propf
> Sent: Sunday, April 20, 2003 4:22 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Newted XML Documents
> 
> 
> Jack Cane wrote:
> > Suppose I am writing a book of many chapters each of which may have
> sections
> > and subsections. To keep things under control I propose to 
> use included
> > files. Thus, the main file will have "book" as the root 
> element and will
> > include chapter files.
> >
> > Each chapter file will have "Chapter" as its root element, 
> and will have
> one
> > or more section files included in it.
> >
> > Section files will have subsections, etc.
> >
> > So, my vision is of a nested set of included files.
> >
> > Will XML support this?
> >
> 
> 
> Yes,  This is how I did it.  I have a file called docroot.dtd 
> like this
> 
> <!ELEMENT docroot (#PCDATA)>
> <!ENTITY doc1 SYSTEM "foo.xml">
> <!ENTITY doc2 SYSTEM "bar.xml">
> 
> 
> I have an xml file called docroot.xml
> 
> 
> <?xml version="1.0"?>
> <!DOCTYPE docroot SYSTEM "docroot.dtd">
> <docroot>
> &doc1;
> &doc2;
> </docroot>
> 
> 
> The & is the include statement that refers to the entities defined in
> the DTD.  I think there may be a way to do this with XSD 
> stylesheets as
> well.  I think that is the preferred way nowadays as dtds are 
> considered
> antiquated.  Still this method does work.
> 
> 
> --
> "Firing people can give you a pretty good buzz, but it's a poor, poor
> substitute for killing.  I realize that now" - Dale Gribble
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread