Home
TeamSite
Can't Include external entity ref within dtd def
pacer11
I am trying to define an internal DTD definition within my available_templates.cfg file that will add an external entity to the xml document. The external entity has a snippet of xml that defines what users are allowed to see what workflow, but I want to maintain this xml outside of the available_templates.cfg file. I was hoping to be able to do it this way but it doesn't seem to work. However if I modify the available_templates.dtd file with the entity definition it works fine. I don't want to do this because I don't want to have to add this everytime there is a new dtd from IW.
I am hoping that I am just doing something wrong, but here is what I have, any feedback is appreciated!!
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
available_templates.cfg
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE available_templates SYSTEM "available_templates.dtd" [
<!ENTITY mylist SYSTEM "userlist.xml">
]>
<available_templates>
<template_file name='Submit Workflow' path='solutions/configurable_default_submit.wft'>
<command_list>
<command value='submit' />
<command value='all' include='no' />
</command_list>
<role_list>
<role value='author' include='no' allusers='yes'/>
<role value='all' include='&yes;' allusers='no'/>
</role_list>
&mylist;
</template_file>
</available_templates>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
userlist.xml
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<user_list>
<user value='jfaniyi' include='yes'/>
<user value='iw-admin' include='no'/>
</user_list>
Find more posts tagged with
Comments
Adam Stoller
I do not believe that the available_templates.dtd can be extended - like this or any other way - TeamSite handles the processing of this and will only look at what it expects to find.
The only supported way to do what you want, that I can think of, is to generate the available_templates.cfg file from "source" (probably versioning it within TeamSite or some other system if desired).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Adam Stoller
Hmm - I just re-read your post - and I'm surprised that modifying the DTD itself works (it's kind of nice that it does, but unexpected).
I won't claim to be an expert in XML at this level - but I'm not sure you can extend an external DTD this way - I think you either have to modify the DTD *or* change the entire thing to be internalized and make your modification that way.
I think you might be better off modifying the DTD and documenting that fact (outside the DTD) so that you can re-apply your changes if/when it gets overwritten by an upgrade / SP
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
pacer11
Interesting...
What kind of parsing routine has IW implemented that it doesn't recognize entities.....isn't this like XML 101?
Oh well...Thanks anyway!!
Migrateduser
Excuse me for this, but I enjoy things like these -- trying to figure out ways to hyperextend things.
What if when userlist.xml is submitted, a script overwrites available_templates.cfg with the values contained therein? Needless to say, this is very risky to put into a production environment and no one would probably WANT to put it into production, but wouldn't that work?
Dave
Dwayne
According to my handy-dandy O'Reilly
XML Pocket Reference
, entity declaration are valid within a DTD, not within a document. Now, I'm quite ready to grant that I'm no expert on the more arcane aspects of XML and DTD interactions, so I could be misreading this entirely, and I'm only looking at one quick reference guide, not the RFC. But it looks to me like IWOV is behaving correctly.
--
Current project: TS 5.5.2/6.1 W2K
pacer11
I am not sure...forgetting for one second that you are in a production environment, I think the problem with the suggestion would be trying to validate the available_templates.cfg file with entity tokens that don't exist...meaning
if I have this in my available_templates.cfg file
<template_file name='Submit Workflow' path='solutions/configurable_default_submit.wft'>
<command_list>
<command value='submit' />
<command value='all' include='no' />
</command_list>
<role_list>
<role value='author' include='no' allusers='yes'/>
<role value='all' include='&yes;' allusers='no'/>
</role_list>
&mylist;
</template_file>
Everytime I submit my userlist.xml file I could have a script replace the "&mylist;" string with what is in the userlist.xml file, but I don't think the available_templates.cfg file will be validated when the workflow tries to pull up the info because of the undefined string...
I haven't really tested this to be sure...but that would be my initial thought.
Migrateduser
I agree, it looks like the system is behaving correctly in this case.
I am not sure if either XML or IW would support it, but an alternative might be to try extending the external DTD by including your entity reference in a DTD fragment at the top of available_templates.xml? If it works, then you would only have to maintain available_templates.xml instead of that and the external DTD, which I agree you don't want to edit.
pacer11
Yes you are right...
but the way I was defining it was within the DTD only it was an internal DTD which was within the document itself...totally valid
Migrateduser
What if there was a default value in available_templates.cfg (say, the local TS admin) in place of "&mylist;"? This way, available_templates.cfg is syntactically correct.
pacer11
If you look up above at the initial post...this is exactly what I was trying to do...it doesn't work...and I think you mean editing the available_templates.cfg...(not available_template.xml)
Adam Stoller
Hmm - maybe this is XML 201 as opposed to 101 - so far I've found one example on-line (
here
) that shows something like what you're doing, though it's using a PUBLIC DTD rather than a SYSTEM DTD (not sure if that makes a difference, but ...)
I also found
this
which also seems to support the idea of extending a DTD, but it's largely mumbo-jumbo that's difficult to find a clear explanation of any constraints on doing so...
Hmm - okay -
this article (scroll towards the bottom)
seems to show a reasonable example using SYSTEM.
Try this: Copy
userlist.xml
into
IWHOME
/httpd/iw/
and then:
<!DOCTYPE available_templates SYSTEM "available_templates.dtd" [
<!ENTITY mylist SYSTEM "/iw/userlist.xml">
]>
OR
<!DOCTYPE available_templates SYSTEM "available_templates.dtd" [
<!ENTITY mylist SYSTEM "/path/to/your/file/userlist.xml">
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Yes I would expect that to work then, if it works in XMLSpy. I wonder if IW is not using a standard parser in this case as well (I know dcts cannot be parsed with standard parsers because inline cannot be (or simply is not) referenced properly in the DTD).
Migrateduser
Yep, I was not paying enough attention. I think you are right, it should work.
pacer11
None of the suggestions worked (not suprising)
I think I may have to result to generating available_templates.cfg on the fly upon some action suggested earlier...submission of the userlist.xml file....although this could be risky...I have to think this through some more.
Thanks for your help!
Migrateduser
Yeah, keeping up with the threads on this post alone is making me dizzy --
I'm wondering if you're thinking of implementing this "workaround" on a production system and if others would have access to changing available_templates.cfg this way, etc. As you've said, it's risky -- but I'm very interested to know if it works well (if you decide to try it out).
Dave
pacer11
Not sure it would work...in the DTD definition you can only have the elements specified in the available_templates definition which does not include PCDATA(loosely defined strings)
Migrateduser
No, I'm actually referring to the scripted method, which basically overwrites available_templates.cfg when userlist.xml is submitted.
Dave