Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 28th, 2008, 07:35 PM
Charles Packer
Guest
 
Posts: n/a
Default Representing duplicated data in XML

Does XML have a way to refer to duplicated data?

Suppose I create a source text that consists of rules for
generating an object text of expanded material when parsed by
a program that knows the rules. Suppose that
one of the rules is long and occurs multiple times in
the source text. I want to have only one instance of this
rule in the source text for compactness and ease of editing
it later. In this example...

..
..
..
<situationsomething </situation>
<action1action specific to something </action1>
<action2>
  #2  
Old August 29th, 2008, 02:45 AM
Jürgen Exner
Guest
 
Posts: n/a
Default Re: Representing duplicated data in XML

Charles Packer <mailbox@cpacker.orgwrote:
Quote:
>Does XML have a way to refer to duplicated data?
>
>Suppose I create a source text that consists of rules for
>generating an object text of expanded material when parsed by
>a program that knows the rules. Suppose that
>one of the rules is long and occurs multiple times in
>the source text. I want to have only one instance of this
>rule in the source text for compactness and ease of editing
>it later. In this example...
Why not define all your rules in one section and assign a unique ID to
each? And later simply reference that ID at the location of the
application instead of textually copying the rule. That's how it is
usually done.
However, what on earth does this have to do with Perl modules?

jue
  #3  
Old August 29th, 2008, 03:15 PM
Charles Packer
Guest
 
Posts: n/a
Default Re: Representing duplicated data in XML

On Aug 28, 5:04 pm, Troy Cauble <t...@alcatel-lucent.comwrote:
Quote:
You could have optional id and ref elements.
>
<action id='myUniqueId'>blah....</action>
...
<action ref='myUniqueId'/>
>
with documentation saying to use a ref attribute *OR* content.
Better than documentation is something you can validate
with DTD/XML Schema/whatever. Such as

Thanks very much for your help. Is this what you had in mind?


<actiondefs>
<action id='oftendone'>
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles