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

EDD: How to create XML tag that can only accept value from an enumerated list

Community Beginner ,
Oct 24, 2009 Oct 24, 2009

Hi,

  I'm new to creating EDD and Structured Apps in FrameMaker (9.0).

  I have seen examples of creating EDD that allow an attribute to take on a value from a list.

  But is it possible to have an element accept a value from a list? If so, how?

Thanks,

Anupam.

TOPICS
Structured
1.9K
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 ,
Oct 24, 2009 Oct 24, 2009

Hi Anupam, and welcome to forum!

in XML, attributes have names and values. Elements have only name and internal strcucture. This structure can consist of elements or text (CDATA) or both of the element can be empty. These structures (and elements ana attributes) are defined in the EDD.

So an element does not have "values", it can have attributes and it can contain internal structure defined by the DTD (Document Type Definition) or by an XML Schema. Their counterpart in framemaker is EDD.

Hope this helps,

Martti

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 ,
Oct 24, 2009 Oct 24, 2009

Hi Martti,

  Thanks for your response. I'm trying to write the equivalent of the following XSD in EDD:

  :

   <xs:element name="sw" type="accessTypeSW" minOccurs="1" maxOccurs="1">

  :

   <xs:simpleType name="accessTypeSW">
        <xs:restriction base="xs:string">
            <xs:enumeration value="ro"></xs:enumeration>
            <xs:enumeration value="wo"></xs:enumeration>

         </...>

  </...>

The "sw" element can take one of the enumerated value ... 'ro', 'wo' etc.

I wonder if its possible and how to do it.

Thanks,

Anupam.

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 ,
Oct 26, 2009 Oct 26, 2009

Hi Anupam,

Now I understand what you were trying to do..;)

To my knowledge, this cannot be done in EDD, it does not support restrictions for text (CDATA). EDD is a derivate from DTD age and DTD's don't support it either.

Martti

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
Guide ,
Oct 26, 2009 Oct 26, 2009

Anupam,

You may not be able to do what you want directly, but you can do it indirectly.

As you noted in an earlier post, the EDD can specify that an element has an attribute that has a value from a list. In the EDD, you can specify that the sw element has an attribute that has ro and wo as its possible values. The EDD can also specify that the element is displayed with a prefix or suffix that is the value of the attribute. This gives the appearance on screen and on paper that the sw element has content, either ro or wo. It is not the same, but it appears to be.

If you are roundtripping between Frame and XML, then you can write an XSLT that transforms the element sw between one that has the attribute and one that has content.

Van

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 ,
Oct 26, 2009 Oct 26, 2009

It is not possible!

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
Enthusiast ,
Oct 26, 2009 Oct 26, 2009

While enumerated lists are not available for element content, FrameMaker 9 does have a new, undocumented feature that allows element content to be restricted to a numeric value.

In an element definition for a Container element you can add the Type element that can contain either Real or Integer elements. I've already found it very useful for restricting data entry because invalid values instantly show up red in the structure view.

It's a sign that some schema related features are becoming available. Let's hope for more schema features in a future release.

Regards

Ian

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 ,
Oct 26, 2009 Oct 26, 2009
LATEST

The EDD enhancement mentioned by Ian was published in March in Adobe’s Technical Communication blog

http://blogs.adobe.com/techcomm/2009/03/structure_view_enhancement_in_framemaker_9_1.html

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