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

Passing #FIXED values through para. entity refrences

  • From: "Amit Rekhi" <amitr@a...>
  • To: <xml-dev@i...>
  • Date: Mon, 29 Jun 1998 16:22:22 +0530

defination of values
Hello All,
                I am in the process of BETTERING  an XML-DTD I made.
 
                In the process of making it compact, I decided to encapsulate all the repeated(in the DTD) attribute definations of elements in parameter entities, and use para. entity refrences in places where the attr. defs. are repeated.
 
                But, all the repeated attributes I want to add to my parameter entity  have  #FIXED and DIFFERENT values at all the places they are repeated at,  as a result of which I am not being able to add them to the para. entity replacement text even though they are repeated.
 
                Let me explain  my problem with an example.
 
                I have the following 2 element declarations :-
 
                <!ELEMENT ele1 (#PCDATA)>
                <!ATTLIST ele1
                                            common-attr CDATA #FIXED "common-attr-value1">
 
                <!ELEMENT ele2 (#PCDATA)>
                <!ATTLIST ele2
                                            common-attr CDATA #FIXED "common-attr-value2">
 
 
                   Since both the elements have AN ALMOST SIMILAR attribute 'common-att' (except the #FIXED values) I want to encapsulate the common-attr attribute defination in a parameter entity and refrence the para. entity at points where I want to add the common-attr defination, so that my DTD would loook like :-
 
               < !ENTITY %attr-def  'common-attr CDATA #FIXED ".................." '>                 
 
                                                                                                                |
                                                                                                                |
                                                                                                               \ /
                                                                                                         What to write here      
 
                <!ELEMENT ele1 (#PCDATA)>
                <!ATTLIST %attr-def; >
 
                <!ELEMENT ele2 (#PCDATA)>
                <!ATTLIST ele2 %attr-def;>
 
But the problem of using a parameter refrence here is that the attribute 'common-attr'  has different  #FIXED values at both the places it is used so a simple refrence like %attr-def; will not give it the required #FIXED values it requires.
 
Concerning this issue I have 3 questions :-
 
1.  Whether encapsulating the attribute common-attr in a para. refrence is proper or not even though the attribute is NOT exactly similar in both places it is used?
 
(I feel it is correct,since the attribute definations at both the places differ only in their VALUE , nothing else!)
 
2. Is there way to pass #FIXED values of SAME parameter definations through their entity refrences(something like parameter passing)? eg.
 
                <!ELEMENT ele1 (#PCDATA)>
                <!ATTLIST  ele1 %attr-def(/*-------pass fixed value here--------*/); >
 
                <!ELEMENT ele2 (#PCDATA)>
                <!ATTLIST ele2 %attr-def(/*-------pass fixed value here--------*/);>
 
3. Is there any way I can add attributes like 'common-attr'(used in the eg. above) to a para. entity and only call its refrence in places it is needed in the DTD making sure that at each calling place a unique #FIXED value is passed?
 
                    Thanx in advance,
 
                                                                                                                        AMIT REKHI
                                                                                                               Software Engineer,
                                                                                                                A.B.Infosys.P.Ltd,
                                                                                                                New Delhi
                                                                                                                INDIA.
 

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.