Copy link to clipboard
Copied
Frame 11
DITA 1.2
Due to restrictions beyond our control, we must use absurdly long product names. Therefore I want to use drop-down lists to make it easier for the authors to select a <prodname> in the metadata.
What I did:
1. In metaDecl.eddmod.fm, I created a new attribute and named it prod.
a. I made it the Choice, and Required.
b. The Choices currently are just Internal and RTVI for testing purposes. I'll put the absurdly long ones in when I have it working.
c. I have a Prefix rule of: In all contexts Prefix: Product Name: <$attribute[prod]>
2. I imported metaDecl.eddmod.fm to all of these EDDs:
In the base EDD folder:
In the technicalContent EDD folder:
3. I imported the element definitions into all of the following:
4. I imported the elememted definitions from task.template.fm into my test document (yes, it is a task topic).
What happened:
I get the following error message in the console:
XML Parser Messages (Document Instance)
Error at file H:\DITA_Westminster\Procedures - Our DITA\Inserting_Product_Names_Versions_In_Metadata\InsertingProductNamesAndVersionsInMetadata.dita.82F, line 28, char 49, Message: Attribute 'prod' is not declared for element 'prodname'
Error at line 28, char 71, Message: Not enough elements to match content model '(prodname,vrmlist,((brand|component|featnum|platform|prognum|series))*)'
What I did next:
1. I removed all elements from the general rule of <prodinfo> with the exception of <prodname>. <prodinfo) is the one that had prodname, vrmlist, (brand|component|featnum|platform|prognum|series) in the general rule. I also did a thorough search to ensure that no other element had this same list of element in the general rule. I couldn't find any.
2. I did the import to the EDDs and templates thing again.
3. I got the same error message again. <sigh />
Question:
Why am I still getting those 2 error messages? They are driving me crazy.
Marsha
The EDD contains structure rules likely derived from the DTD, but is a separate file used by the Structured Application.
You should be able to see the location of your DTD in the StructApps file. Use Structure Tools > Edit Structured Application File to open it from the FM menu.
Copy link to clipboard
Copied
Hello Marsha,
I think you will have to adapt the DTD as well (guess that's where the XML parser error comes from).
To do so, you'll need to add the attribute "prod (<productname1>|<productname2>|<productnamex>) #IMPLIED" to the ATTLIST of the prodname element.
Example:
<!ELEMENT prodname EMPTY>
<!ATTLIST prodname
prod (Book|Candle|Cookie) #IMPLIED
>
good luck,
Alex
Copy link to clipboard
Copied
Thanks, Alex.
That makes sense, but where do I find the DTD? I thought the EDD included the DTD.
Marsha
Copy link to clipboard
Copied
The EDD contains structure rules likely derived from the DTD, but is a separate file used by the Structured Application.
You should be able to see the location of your DTD in the StructApps file. Use Structure Tools > Edit Structured Application File to open it from the FM menu.
Copy link to clipboard
Copied
Thanks for jogging my memory, Matt. I had forgotton about that. Too much going on!
Marsha
Copy link to clipboard
Copied
Alex Gorly and Matt Sullivan solved one of my issues above:
Message: Attribute 'prod' is not declared for element 'prodname'
I'm still stumpled on the other one:
Message: Not enough elements to match content model '(prodname,vrmlist,((brand|component|featnum|platform|prognum|series) )*)'
As stated above, I've even removed everything from the general rule of <prodinfo> except prodname and I'm still getting the same error. I've searched everywhere for this general rule and <prodinfo> is the only place I can find it.
What I really want is: (prodname), (vrmlist)?, (brand | component | featnum | platform | prognum | series)*
so that vrmlist is optional.
No matter what I do, unless I include a vrmlist, I get the above message. Currently, our CMS can't handle vrmlist but I don't want to remove it altogether because we may be replacing our CMS.
Help please!
Copy link to clipboard
Copied
Hello Marsha,
same construction site again ![]()
The elements in the DTD need to match the ones in the EDD.
So, if the general rule in your EDD is this:
General Rule: (prodname),(vrmlist)?,(brand|component|featnum|platform|prognum|series)*
The entry in the DTD has to look like this:
<!ELEMENT prod (prodname,vrmlist?,(brand|component|featnum|platform|prognum|series)*)>
Hope that helps ![]()
Alex
Copy link to clipboard
Copied
Thanks again, Alex.
Out of curiosity, how did you figure this out? It makes sense, but...
Marsha
Copy link to clipboard
Copied
Hello Marsha,
I guess I became kind of an expert in decrypting FMs error messages, while fiddling around with our own structure ![]()
What brought me to these conclusion was the following expression: match content model
The content model is created by the DTD, so that's the place to look for the error.
And if you're roundtripping stuff (what you do, if you work with XML files), you'll always have to keep EDD, RWR, XSLs and DTD consistent.
Cheers
Alex
Copy link to clipboard
Copied
Fantastic. Thanks, Alex.
I'll keep your tip in mind.
Marsha
Copy link to clipboard
Copied
Marsha, just as an observation, you might eliminate some of the extra parentheses from your rules.
Although things will still work as written, the rule
General Rule: (prodname),(vrmlist)?,(brand|component|featnum|platform|prognum|series)*
would be easier to decipher if written as
General Rule: prodname, vrmlist?,(brand|component|featnum|platform|prognum|series)*
likewise, earlier you had a set of parens that simply wrapped a set of parens.
Note that Alex had kindly removed the extra parens from the rule for the DTD.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more