This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting the value of an entity


Sorry for my precipitation in asking my last question. What I though
that were the same problem, finally they were different problems.
I have resolved the problem with the images (that is the example
I sent previously): In xslt exists the funtion 
     string unparsed-entity-uri(string)
that returns the URI of the unparsed entity with the specified name.

I still have a problem with the use of a xslt stylesheet and a 
xml document that include other xml subdocuments declared as 
unparsed entity.

In the book "Structuring XML Documents" is recommended  that when
you want to include a subdocuments in a xml document you should
the following scheme
- First, declare a notantio for the XML documents
      <!NOTATION XML SYSTEM "http://www.w3.org/XML/";>
- Second, declare an NDATA entity for each subdocuments
      <!ENTITY chap01 SYSTEM "chap01.xml" NDATA XML>
      <!ENTITY chap02 SYSTEM "chap02.xml" NDATA XML>
- Third, declare an element type (usually empty) with an
  ENTITY attribute to act as a placeholder for the subdocuments
      <!ELEMENT chapter-ptr EMPTY>
      <!ATTLIST chapter-ptr source ENTITY #REQUIRED>
So, now in the document you should put something like this
     <body>
     <chapter-ptr source="chap01"/>
     <chapter-ptr source="chap02"/>
     </body>
Using this scheme each subdocument can have his own DOCTYPE declaration.

The problem is that when I use a browser (IE or mozilla) to visualice
the document with his associated XSLT stylehseet, it does not
include the subdocuments. I want to know if this is the supposed 
way of operation for an XSLT transformation motor, if so how can
access to the content of the subdocuments? and how can apply the
stylesheet of the main document? Another question arise, if I use
that scheme of including subdocuments, Does the browser validate 
the subdocuments?  if so what DTD it use the DTD of the main
document or the DTDs of the subdocuments?

---------------------------------------------------------------------
César Ignacio García Osorio                  phone : +34 947 258989
Área de Lenguajes y Sistemas Informáticos            +34 947 258970
Escuela Politécnica Superior                 fax   : +34 947 258910
Universidad de Burgos.                       e-mail: cgosorio@ubu.es
Av. Cantabria S/N
09006 - Burgos. Spain.
---------------------------------------------------------------------


: I want to know if using a XSLT stylesheet is possible to access
: to the information associated to a entity. I explain it using
: an example:
: 
: I have a document like this:
: 
: <?xml version="1.0"?>
: <!DOCTYPE root [
:   <!NOTATION GIF PUBLIC "+//ISBN 0-7923-1::Graphic Notation//NOTATION
: Microsoft Windows bitmap//EN">
:   <!ELEMENT root (include, txt)>
:   <!ELEMENT txt (#PCDATA)>
:   <!ELEMENT include EMPTY>
:   <!ATTLIST include ref ENTITY>
:   <!ENTITY mygif SYSTEM "draw.gif" NDATA GIF>
:   ]>
:<root>
:  <include ref="mygif"/>
:  <txt>
:  Some text
:  </txt>
:</root>
:
:And I want that my stylesheet generates something like this
:
:<html>
:<head><title>A title</title></head>
:<body>
:<a img="draw.gif"/>
:Some text
:</body>
:</html>
:
:And for that I need to access to the name of the gif file
:("draw.gif" in the example) that is associated with the
:entity mygif.
:
:Thanks in advance

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]