Lists Home |
Date Index |
hmmm... fixed my problem.
interesting, because that's not obvious from some of the books - got it
from the xsl faq.
it does mean i'm commited now to dtds :) so please keep them in any xml 2.0
Rick Marshall wrote:
> <?xml version="1.0"?>
> <!DOCTYPE label [
> <!ELEMENT vpn EMPTY>
> <!ATTLIST vpn code ENTITY #REQUIRED>
> <!NOTATION VPN SYSTEM "/usr/local/app/shoeman/bin/vpn">
> <!ENTITY codex SYSTEM "1234" NDATA VPN>
> <label_file><vpn code="codex" /></label_file>
> ok, a bit more background here. i am trying to overcome a somewhat
> classic "late-binding" problem.
> we get requests to print labels. the request come as text files that
> are converted to xml and stored. the text file has everything we need
> to print the labels except for some local info (essentially our
> product number). sometime between receiving the files and actually
> printing the labels all the data bits are filled in and we do have the
> required product number. this can be identified from a code supplied
> by the customer.
> the code above is a simplified version just to illustrate the point.
> when we produce the final output (zebra printer codes in this case) we
> need to include our product code. so what i want to do is embed in the
> xml a call to a function in our system that, when passed the customer
> code, will return our product code.
> everything i've read suggests that the above snippet should work
> (assuming /usr/local/app/sheoman/bin/vpn is executable and returns
> and here is the simplified stylesheet:<xsl:stylesheet version="1.0"
> <xsl:output method="text"/>
> <xsl:template match="/">
> <xsl:apply-templates match="label_file"/>
> <xsl:template match="label_file">
> <xsl:apply-templates match="vpn"/>
> <xsl:template match="vpn">
> YY </xsl:text>
> <xsl:value-of select="@code"/>
> <xsl:text> ZZ</xsl:text>
> and the output:
> YY codex ZZ
> as you can see the entity "codex" is not being replaced by the call
> to /usr/local/...
> i can devise alternatives, but they would not be xml solutions and
> that has other problems downstream.
> ps if this is the correc tsolution then it is a good reason to hang on
> to dtds.
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>To subscribe or unsubscribe from this list use the subscription
tel;cell:+61 411 287 530