I'm forwarding another message from Rick Geimer regarding unparsed
entities. Any help with implementing this feature will be most welcome.

Tom


Kaiserovi wrote:

> I haven't thought about this but it looks like a good idea. I hope you
> won't mind my forwarding your message to the Sablotron list, just in
> case someone feels like implementing the function (we won't manage for
> some time now).

Tom,

Thanks for taking the time to address this issue. I've got some more
info you might want to forward this to the list as well. 

Here is a very rough cut of how you might define an unparsed entity
extension. Let me know what you think. 

You could do this with an extension tag:

        <!ELEMENT sablotron:unparsed-entity-declaration EMPTY >
        <!ATTLIST sablotron:unparsed-entity-declaration
                name            CDATA #REQUIRED
                notation        CDATA #REQUIRED
                system-id       CDATA #REQUIRED
                public-id       CDATA #IMPLIED
                >
                
which would look like this (omitting the optional public identifier):           

        <sablotron:unparsed-entity-declaration 
                name="test" 
                notation="gif" 
                system-id="test.gif"/>

or as an extension function. The second one is an overloaded version of
the first, allowing for an optional public identifier (sort of Java
psuedo-code):

        public void sablotron:unparsed-entity-declaration(
                String name, 
                String notation, 
                String system-id )

        public void sablotron:unparsed-entity-declaration(
                String name, 
                String notation, 
                String system-id , 
                String public-id)
        
which could be called as follows:

        sablotron:unparsed-entity-declaration("test","gif","test.gif")
        
In either case, this would result in an entity being added to the
declaration subset when serialized.

        <!DOCTYPE foo [
        <!ENTITY test SYSTEM "test.gif" NDATA gif>
        ]>
        
It would also be useful to have a companion tag/function for outputting
notations to the declaration subset:


        <!ELEMENT sablotron:notation-declaration EMPTY >
        <!ATTLIST sablotron:notation-declaration
                name            CDATA #REQUIRED
                public-id       CDATA #REQUIRED
                system-id       CDATA #IMPLIED
                >

        <sablotron:notation-declaration 
                name="gif" 
                public-id="-//NATIONAL//NOTATION Compuserve gif format//EN"/>
        
or

        public void sablotron:notation-declaration(
                String name, 
                String public-id )
                
        public void sablotron:notation-declaration(
                String name, 
                String public-id, 
                String system-id )
        
        sablotron:notation-declaration("gif","-//NATIONAL//NOTATION Compuserve
gif format//EN")
        
Which would result in something like the following when combined with
the first extension:

        <!DOCTYPE foo [
        <!NOTATION gif PUBLIC "-//NATIONAL//NOTATION Compuserve gif format//EN"
"">
        <!ENTITY test SYSTEM "test.gif" NDATA gif>
        ]>

The only place where I see a problem with either
sablotron:unparsed-entity-declaration or sablotron:notation-declaration
is with duplicate entries, i.e. what if I try to output the same entity
or notation name twice in the stylesheet? With entities you could output
it twice and let the parser sort it out, but I believe it is an error to
redefine notations. Probably the best bet would be to just output the
last defined set of values for any notation or entity name. 


Rick Geimer
National Semiconductor
[EMAIL PROTECTED]



> Rick Geimer wrote:
> >
> > Hello,
> >
> > I wonder if you would consider adding an extension fuction to Sablotron
> > that would allow users to output unparsed entities to the declaration
> > subset of a serialized XML document. Unparsed entities are often used in
> > publishing applications to manage graphics, and XSLTs lack of support
> > for them means that I can't use it where I would like to. I feel a
> > Sablotron extension function would a) give me an opportunity to use XSLT
> > where I currently cannot (even if it isn't completely portable, and b)
> > push the xsl editors to add support for this feature in XSLT 2.0 (or
> > maybe even 1.1, but I doubt it).
> >
> > Thanks for your time.
> >
> > Rick Geimer
> > National Semiconductor
> > [EMAIL PROTECTED]




Reply via email to