|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: use of xsl:key in cross-referencing
Xiaocun Xu wrote:
Hi, All: Yes, XML has a built-in cross-reference mechanism which uses special attribute types called ID and IDREF. If you modify your DTD: <!ELEMENT cell (#PCDATA)>
<!ATTLIST cell column CDATA #REQUIRED
questionnaire ID #IMPLIED
question IDREF #IMPLIED>Now you can say: <row row="16"> <cell column="1">References Name</cell> <cell column="2" questionnaire="ABC123">References</cell> <cell column="3">References Description</cell> </row> ...<rows in between skipped for brevity>... <row row="28"> <cell column="1" question="ABC123">References</cell> <cell column="2">text of Question 8<cell> </row> <row row="29"> <cell column="1" question="ABC123">References</cell> <cell column="2">text of Question 9</cell> </row> The ID/IDREF mechanism is one-to-many, so if I have understood you right, this is what you want. The advantage is that ID/IDREF checking is built into validating parsers, so a validation will immediately pick up on any IDREF attribute trying to reference a non-existent ID value (but it's OK to have an ID value which never gets referenced). The only restriction is that ID/IDREF values must be Names (they must begin with a letter and may not contain spaces). ///Peter XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








