• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Editing dtd file to allow certain elements but not use them in a tree display.

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the dtd file in its current form:



You can see it allows for project, name, device, and deviceName elements in my xml. It is like this now, because all of those are being used to populate the nodes of a tree. However, the actual xml I will be using will contain these elemnts plus a few more element that will nto be part of the tree. SO I need to edit this dtd file to allow these other elements to be part of my xml file, but just not take them into consideration.

To put it another way I my xml file will contain those fourelements it already allows for, btu there will be a few other elements as well. Right now if I try to put those elements in my xml file it tells me

The content of element type "project" must match "(name,(project|device)*)".

So I am sure I need to add some more to the dtd document, but not totally sure what. For now lets say i want to add a properties element tag. I am guessing that the second line in my dtd there will need to be changed to <!ELEMENT project (name,(project|device|properties)*)>

ANd then properties will need its own line further down in the code. But if I follow the convention that is already there, it will end up in the properties element being dispalyed in my tree, and it is not supposed to.

So is this possible with dtd, can you put in extra elements and then tell it to alow, but ignore those eleemnts?

Ill be looking into this on my own but Im posting this now in the hopes someone will head me off in the right direction in case I have trouble on my own

Thanks
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand the question. The DTD simply describes what the document SHOULD look like. It doesn't ignore them and it doesn't not ignore them. That doesn't mean anything.

If you need your application to ignore elements, or to not ignore elements, then by all means write it to do those things.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see, I misunderstood what the dtd file was used for. I changed it and now it allows for a property element, and since the program already does not look for the property tag no other change is needed.

Thanks

edit - try this on for size - https://coderanch.com/t/446839/XML-Related-Technologies/Have-tree-displayed-using-javascript
 
reply
    Bookmark Topic Watch Topic
  • New Topic