DTD Modifications Issues
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 7
- Joined: Thu Mar 06, 2014 9:14 pm
DTD Modifications Issues
Hi,
I've been modifying my DTD and have two issues.
1) I want to allow @id attributes not to be unique anymore. For that, I replaced all the occurrences of the type of @id: from ID (i.e. a unique ID) to CDATA. I also made sure to replace those occurrences in dependent .dtd or .mod files. Still, it seems that a couple of @id won't be accepted as non-unique. I was wondering if there was a way to specify a single rule in the DTD to have all @id attributes to be CDATA.
2)I need to allow a table entry (marked up as <entry>) to have any kind of child element. The entry is declared as an entity, the following way:
<!ENTITY % tbl.entry.mdl "entity_values">
What I'd like is for the "entity_values" to have any content. I did a fair bit of research but wasn't able to find anything that enabled that. I found out about the "ANY" keyword for ELEMENT but that's not what I want. Right now, I hardcoded a few potential child tags (let's call them <value1>, <value2> etc...) for entity_values as a list ("value1 | value2 | ...") but that could potentially be very long.
Any input on one of those issues would be great!
Thanks,
Jonathan
I've been modifying my DTD and have two issues.
1) I want to allow @id attributes not to be unique anymore. For that, I replaced all the occurrences of the type of @id: from ID (i.e. a unique ID) to CDATA. I also made sure to replace those occurrences in dependent .dtd or .mod files. Still, it seems that a couple of @id won't be accepted as non-unique. I was wondering if there was a way to specify a single rule in the DTD to have all @id attributes to be CDATA.
2)I need to allow a table entry (marked up as <entry>) to have any kind of child element. The entry is declared as an entity, the following way:
<!ENTITY % tbl.entry.mdl "entity_values">
What I'd like is for the "entity_values" to have any content. I did a fair bit of research but wasn't able to find anything that enabled that. I found out about the "ANY" keyword for ELEMENT but that's not what I want. Right now, I hardcoded a few potential child tags (let's call them <value1>, <value2> etc...) for entity_values as a list ("value1 | value2 | ...") but that could potentially be very long.
Any input on one of those issues would be great!
Thanks,
Jonathan
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: DTD Modifications Issues
Hi,
1. I don't see a way to have a single rule that does this.
May I ask why are you doing this (allowing non-unique IDs)?
If you have stylesheets that assumed the IDs are unique, you're going to have some trouble on the new model.
2. would be the correct solution.
What you seem to want to do is hijack the internal parameter entity and replace it with something else:
You haven't mentioned how this entiry is used. In common DTDs I've seen it used like this:
If that's the case, you can rewrite the internal parameter entity like this:
Regards,
Adrian
1. I don't see a way to have a single rule that does this.
May I ask why are you doing this (allowing non-unique IDs)?
If you have stylesheets that assumed the IDs are unique, you're going to have some trouble on the new model.
2.
Code: Select all
<!ELEMENT entry ANY>
What you seem to want to do is hijack the internal parameter entity and replace it with something else:
Code: Select all
<!ENTITY % tbl.entry.mdl "entity_values">
Code: Select all
<!ELEMENT entry %tbl.entry.mdl;>
Code: Select all
<!ENTITY % tbl.entry.mdl "ANY">
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Thu Mar 06, 2014 9:14 pm
Re: DTD Modifications Issues
Thank you Adrian!
<!ELEMENT entry ANY> did the trick for allowing any child element for <entry> tags. I was focusing on trying to change the existing entity but this solution is way more straightforward and makes more sense!
About the non-unicity of IDs, I actually have a table that has an indefinite number of rows and 4 columns. For a given row, the columns contain exactly the same markup but different content. A column entry is written as follows:
<value1 id=my_id">content[column i]</value1>.
It's not possible to change the markup, so the IDs will be the same for the four entries of a given row. I might actually be able to alter the ID if necessary, e.g. append a distinctive character at runtime and then remove it later, but ideally I would have liked to just overwrite the unicity of IDs.
<!ELEMENT entry ANY> did the trick for allowing any child element for <entry> tags. I was focusing on trying to change the existing entity but this solution is way more straightforward and makes more sense!
About the non-unicity of IDs, I actually have a table that has an indefinite number of rows and 4 columns. For a given row, the columns contain exactly the same markup but different content. A column entry is written as follows:
<value1 id=my_id">content[column i]</value1>.
It's not possible to change the markup, so the IDs will be the same for the four entries of a given row. I might actually be able to alter the ID if necessary, e.g. append a distinctive character at runtime and then remove it later, but ideally I would have liked to just overwrite the unicity of IDs.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service