Subject: Re: Populate attribute values? From: Mike Brown <mike@xxxxxxxx> Date: Mon, 24 Apr 2000 12:15:16 -0600 (MDT) |
> 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Populate attribute values?, Medina, Edward | Thread | RE: Populate attribute values?, Medina, Edward |
RE: ISO Entity Sets and UNICODE, Selva, Francis | Date | Re: ISO Entity Sets and UNICODE, Mike Brown |
Month |