Skip to main content
1-Visitor
February 25, 2014
Question

attribute value with percent sign

  • February 25, 2014
  • 13 replies
  • 2371 views

Hi,


I am trying to create some generated text in a fosi for several different attribute values for Units of Measurement. In the DTD, there is an attribute value of "%" for percentage units.


<xs:enumeration value="%"/">


Is this a reserved character in fosi? because when you choose this value in the document and then attempt to format the document, the value isn't recognized as matching anything, it generates an error in Editor:


[A27023]
The value of this <specval attval="%"> does not conform to the Declared Attribute Value (ENUMERATED) of the attribute in the document instance against which the <specval> tests


Any advice?


Thanks, KM

    13 replies

    kmccain1-VisitorAuthor
    1-Visitor
    February 27, 2014

    It is a schema: it is declared like this -


    <xs:attribute name="quantityUnitOfMeasure" type="quantityUnitOfMeasureAttType"/">
    <xs:simpletype name="quantityUnitOfMeasureAttType">
    <xs:restriction base="xs:string">


    <xs:enumeration value="%"/">



    KM

    1-Visitor
    February 27, 2014
    Kim,



    I still think that the <fillval> is the route you want to go. The example I
    passed to you yesterday had one error (and really should not have worked).
    Here is an example of a <fillval> that I know has worked in the past.

    <fillval attname="pretext" fillcat="usetext" fillchar="source">



    In your case, the 'attname' would be "quantityUnitOfMeasure". The 'attloc'
    would be used if the attribute is not in the current element. There is NO
    'attval' in <fillval> (my mistake the last time).



    I looked at the S1000D version 4 schema. There are nearly 1,300 allowable
    values for the "quantityUnitOfMeasure" of which "%" is one of them. So if
    you want to display the value of the attribute in your output, the <fillval>
    is your best bet.



    Now if you are only wanting to show those elements where the attribute value
    is "%". Then a mix of a <specval> and <fillval> should work for you.

    If you like, we can take this offline.

    Lynn


    kmccain1-VisitorAuthor
    1-Visitor
    February 28, 2014

    Lynn - Yes, I realized that the attval was invalid.


    My problem is that although it would be easier to just use a fillval to generate the text for every possible value of the attribute by using the value of the source, there are many exceptions where the attribute value is not what is wanted for display, e.g., instead of "deg" they want to see the degree symbol, instead of the word "plus" it should be the plus symbol, etc. That's why I went with individual specvals to determine the content for display even though it was a tedious way to do it. I'm no FOSI expert so I probably am doing things the wrong way around.


    If you can help me get just this percent sign working, I'd be glad to take it offline.Do you need my email address?


    KM