Skip to main content
10-Marble
November 30, 2011
Question

Unbalanced Tag Error in FOSI Usetext

  • November 30, 2011
  • 24 replies
  • 3634 views

I'm trying to add metadata and bookmarks when publishing a document to PDF using a FOSI stylesheet. I've added a usetext to the root tag however everytime I try to apply the FOSI changes I receive a "Generated text contains unbalanced tags, i.e. begin tags without ends, or vice versa. Cannot insert."


I would appreciate any help you could offer,


FOSI Code:


<e-i-c gi="comdtinst">
<charlist>


<usetext source="!&lt;atidmd:DocumentMetaData source="atend"&gt;&lt;/atidmd:DocumentMetaData&gt;!" placemnt="before"></usetext>


<usetext source="!&lt;atidmd:DocumentMetaData"><atidmd:outline><atidmd:bookmark><atidmd:title>Book Title</atidmd:title></atidmd:bookmark></atidmd:outline></atidmd:documentmetadata>!" placemnt="after"></usetext>


</charlist>
</e-i-c>


    24 replies

    November 30, 2011
    If I remember correctly, if your construction rule contains markup with attribute values in it, you have to have the exclamation at the beginning AND end of each tag in the tag pair.
    1-Visitor
    November 30, 2011
    This isn't much help, but I have gotten that error message when unbalanced tags were not really the problem. That was some years back, so unfortunately I don't recall what the real problem was.

    Good luck!
    Suzanne Napoleon
    www.FOSIexpert.com
    "WYSIWYG is last-century technology!"


    1-Visitor
    November 30, 2011
    Do you have a namespace declaration for atidmd in your fosi?



    Try adding the following "attribute specification" to your outspec tag:


    10-Marble
    November 30, 2011
    Thanks for your response. Unfortunately that didn't work.


    November 30, 2011
    Paul is right about the namespace, but I would have thought it would throw a different error.

    Usually start and end tags still require commas to separate them. Try this:

    source='!<atidmd:documentmetadata source="atend">!,!</atidmd:documentmetadata>!'
    10-Marble
    November 30, 2011
    WOW!! Thanks for the heads up. I pulled this code right out of the Arbortext Help files so I can only ASSUME that it is correct.




    10-Marble
    November 30, 2011
    Ok. I added the name space to the outspec tag

    <outspec fosicite="xmlns:atidmd="&lt;a style="COLOR: blue; TEXT-DECORATION: underline" target="_BLANK" href="http://www.arbortext.com/namespace/DocumentMetaData">">http://www.arbortext.com/namespace/DocumentMetaData">



    And



    I added the !,! in between the tags. Still getting the same error.



    <usetext source="!&lt;atidmd:DocumentMetaData source="atend"&gt;!,!&lt;/atidmd:DocumentMetaData&gt;!" placemnt="before"></usetext>




    1-Visitor
    November 30, 2011
    I think you need commas between your pseudo-tags.
    18-Opal
    November 30, 2011
    Hi Sarah--



    Just to make sure, you should remove the after gentext when testing
    this to avoid confounding.



    In other words, try this:



    <e-i-c gi="comdtinst">
    <charlist>

    <usetext source="!&lt;atidmd:DocumentMetaData&lt;br /&gt;source="atend"&gt;!,!&lt;/atidmd:DocumentMetaData&gt;!" <br="/>placemnt="before"></usetext>



    </charlist>
    </e-i-c>

    If that works, then you're on the right track; apply the same logic to
    the after gentext, and Bob's your uncle.



    --Clay



    Clay Helberg

    Senior Consultant

    TerraXML


    1-Visitor
    November 30, 2011
    I don't think you need the exclamation marks, just the commas.