[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: extrernal entities - part 2


xsltproc entities
Robert Koberg wrote:

> Why are you using XML? Seems like you have a fundamental 
> misunderstanding (OK, you have corrected some extreme beginner 
> mistakes) of what XML is and what is is good for...

ultimately we have to translate a variety of document formats into 
commands for different printers. so i normalise the documents to an xml 
format and then use xsltproc to produce targeted outputs. not the only 
solution, but a very neat one.

i guess i could put it into the database as well and have it output the 
target info. lots of ways to skin this cat.

as for extreme beginner mistakes - xml is very big (in some ways) and as 
each branch is approached the opportunity for extreme <aside>the most 
overworked word in english at the moment</aside> beginner mistakes is 
always there. i expect to make them for many years yet ;)

rick

>
> -Rob
>
>
> 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 
>> something).
>>
>> and here is the simplified stylesheet:<xsl:stylesheet version="1.0" 
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>
>>        <xsl:output method="text"/>
>>
>>        <xsl:template match="/">
>>                <xsl:apply-templates match="label_file"/>
>>                </xsl:template>
>>
>>        <xsl:template match="label_file">
>>                <xsl:text>
>> XX</xsl:text>
>>                <xsl:apply-templates match="vpn"/>
>>                </xsl:template>
>>
>>        <xsl:template match="vpn">
>>                <xsl:text>
>> YY </xsl:text>
>>                <xsl:value-of select="@code"/>
>>                <xsl:text> ZZ</xsl:text>
>>                </xsl:template>
>>
>>        </xsl:stylesheet>
>>
>> and the output:
>>
>> XX
>> 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.
>>
>> rick
>>
>> -----------------------------------------------------------------
>> 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
>> manager: <http://www.oasis-open.org/mlmanage/index.php>
>
>
>
> !DSPAM:420ac88d52601198355258!
>

begin:vcard
fn:Rick  Marshall
n:Marshall;Rick 
email;internet:rjm@z...
tel;cell:+61 411 287 530
x-mozilla-html:TRUE
version:2.1
end:vcard


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.