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

Re: Populate attribute values?

Subject: Re: Populate attribute values?
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 24 Apr 2000 12:15:16 -0600 (MDT)
populate attribute with text
> Is it possible to populate an attribute value with a                      
> file which contains a list of n values?  What I want to do
> is have the person authoring the document [...] enter a value
> [...] as an enumerated list from an extensive list
> [...]
> I think the best method would be to use an Entity.

This does not seem to have anything to do with XSL.
You should post to comp.text.xml or the xml-dev list.

> DTD
> 
> <!ENTITY % trigraph"
> attribute (AAA|AAB|AAC|AAD|AAE|AAF|...  
>         ZZW|ZZX|ZZY|ZZZ)    #REQUIRED ">
>         
> XML     
> 
> <!ELEMENT para (title|text)*>
> <!ATTRIBUTE para
>               %trigraph >

You titled that section 'XML', but it's just more of your DTD.

A parameter entity is just saving you some typing. You create
the entity -- either an external file or a quoted text string
right in your DTD -- and then give it a name. Then you can refer
to the entity by name. You can't refer to subsets of information
in the entity.

There are also limitations on the use of parameter entities and
I'm not sure your posted example would actually work. Also note
that in the DTD example above, you are:
 1. enumerating a list of values that the attribute *can* have;
 2. constraining the value to be *one* of the items in the list;
 3. constraining each item to be a NMTOKEN

If #2 and #3 are acceptable, you can accomplish #1 using an
external file, but not without the use of entities. By
definition, an external file *is* an entity, whether you declare
it or not. You would put the text (AAA|AAB|AAC|...) in a file,
and then reference it as the replacement text for the parameter
entity like this:

<!ENTITY % trigraphValues SYSTEM "externalFile.txt">
<!ELEMENT para (title|text)*>
<!ATTLIST para
	trigraph %trigraphValues; #REQUIRED>

If #2 and #3 are not what you want, a DTD just isn't going to do
the job.

Follow-ups to the appropriate forum, please.


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


Current Thread

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
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.