Skip to main content
10-Marble
Nov 30, 2011 8:19 PM UTC
Question

Unbalanced Tag Error in FOSI Usetext

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

    Nov 30, 2011 8:27 PM UTC
    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.
    Translate
    1-Visitor
    Nov 30, 2011 8:34 PM UTC
    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!"


    Translate
    1-Visitor
    Nov 30, 2011 8:42 PM UTC
    Do you have a namespace declaration for atidmd in your fosi?



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


    Translate
    10-Marble
    Nov 30, 2011 8:48 PM UTC
    Thanks for your response. Unfortunately that didn't work.


    Translate
    Nov 30, 2011 9:00 PM UTC
    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>!'
    Translate
    10-Marble
    Nov 30, 2011 9:00 PM UTC
    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.




    Translate
    10-Marble
    Nov 30, 2011 9:13 PM UTC
    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>




    Translate
    1-Visitor
    Nov 30, 2011 9:19 PM UTC
    I think you need commas between your pseudo-tags.
    Translate
    18-Opal
    Nov 30, 2011 9:21 PM UTC
    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


    Translate
    1-Visitor
    Nov 30, 2011 9:23 PM UTC
    I don't think you need the exclamation marks, just the commas.
    Translate