Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Creating drop-down list for <prodname> element in <metadata> causes errors

Community Beginner ,
May 13, 2013 May 13, 2013

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:

  • basemap.edd.fm
  • basetopic.edd.fm
  • map.eddmod.fm
  • topic.eddmod.fm

   In the technicalContent EDD folder:

  • concept.edd.fm
  • ditabase.edd.fm
  • generalTask.edd.fm
  • glossentry.edd.fm
  • glossgroup.edd.fm
  • reference.edd.fm
  • task.edd.fm
  • topic.edd.fm

3. I imported the element definitions into all of the following:

  • ChapterOutputTpl.fm
  • basemap.template.fm
  • basetopic.template.fm
  • basetopic.template.fm
  • topic.template.fm
  • generalTask.template.fm
  • glossentry.template.fm
  • glossgroup.template.fm
  • map.template.fm
  • ditabase.template.fm
  • reference.template.fm
  • concept.template.fm
  • task.template.fm

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

TOPICS
Structured
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 14, 2013 May 14, 2013

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.

Translate
Contributor ,
May 14, 2013 May 14, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 14, 2013 May 14, 2013

Thanks, Alex.

That makes sense, but where do I find the DTD? I thought the EDD included the DTD.

Marsha

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 14, 2013 May 14, 2013

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.

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 14, 2013 May 14, 2013

Thanks for jogging my memory, Matt. I had forgotton about that. Too much going on!

Marsha

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 14, 2013 May 14, 2013

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 15, 2013 May 15, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 15, 2013 May 15, 2013

Thanks again, Alex.

Out of curiosity, how did you figure this out? It makes sense, but...

Marsha

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 15, 2013 May 15, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 15, 2013 May 15, 2013

Fantastic. Thanks, Alex.

I'll keep your tip in mind.

Marsha

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2013 May 15, 2013
LATEST

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.

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines