Create XML Element Tag BasedOn Found Character Style

Hi,
Good Day!
Basically I want to search only for character styles that contains "ntb-", that is why it is hard coded in my searchString variable.
Although I was able to create XML tag based on selected character style, but it will always add/insert at the end of the parent XML element.
Can anyone could help me how insert/add that element at the insertion point where the text is found?
Thanks,
--elmer
var myDoc = app.documents[0];
myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.POINTS;
myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.POINTS;
var charStyles = myDoc.allCharacterStyles;
var foundStyles = Array();
var searchString = String();
    searchString = 'ntb-';
var tempName = String();
var tempName1 = String();
for(var i = 1; charStyles.length > i; i++){
   tempName = charStyles[i].name;
   tempName1 = tempName.toLowerCase();
   if(tempName1.indexOf (searchString.toLowerCase()) != -1){
       foundStyles.push (tempName);
var myDialog = app.dialogs.add({name: "Convert Footnote Character Styles to XML Tags",canCancel:true});
with (myDialog) {
    with (dialogColumns.add().borderPanels.add()) {
        with (dialogColumns.add()) {
            staticTexts.add({staticLabel: "Character style to search : "});        }
        with (dialogColumns.add()) {
            selCharStyle = dropdowns.add({stringList: foundStyles, selectedIndex: 0, minWidth: 175});
var dialogShown = myDialog.show();
while (dialogShown) {
    if (selCharStyle.selectedIndex == 0) {
        alert("Must have at least a character style to search!");
        dialogShown = myDialog.show();
        continue;
    } else {
        insertXMLTags(selCharStyle.stringList[selCharStyle.selectedIndex], selCharStyle.selectedIndex, "0");
        break;
myDialog.destroy();
alert("Finished!");
exit();
function insertXMLTags(cStyle, cStyleIndex, ip) {
    var myFinds = searchStyle(cStyle, cStyleIndex);
    for (i=myFinds.length - 1; i>=0; i--) {
        var myIP = myFinds[i].texts.item(0).insertionPoints.item(0);
        var myParentXML = myIP.associatedXMLElements[0];
        var myChiidXML = myParentXML.xmlElements.add ( cStyle );
        myChiidXML.contents =  myFinds[i].contents;
        //set the selection
        app.selection = myFinds[i].texts.item(0);
        //remove the selected text
        myFinds[i].texts.item(0).remove();
        Utility Functions         
function searchStyle(cStyle, cStyleIndex){
    var myFinds;
    // if script version is for Indesign CS2
    if (app.scriptPreferences.version < 5){                                 
        app.findPreferences = NothingEnum.nothing;
        app.changePreferences = NothingEnum.nothing;
        myFinds = myDoc.search(undefined, undefined, undefined, undefined,
        {appliedParagraphStyle: pStyle, appliedCharacterStyle: cStyle});
    // else, for CS3 and CS4
    }else{                                 
        //Clear any existing find/change settings
        app.findTextPreferences = NothingEnum.nothing;
        app.changeTextPreferences = NothingEnum.nothing;
        // set character or paragraph style to search
        if (cStyleIndex != 0){ 
            app.findTextPreferences.appliedCharacterStyle = cStyle;
        //Set the find options.
        app.findChangeTextOptions.caseSensitive = false;
        app.findChangeTextOptions.includeFootnotes = true;
        app.findChangeTextOptions.includeHiddenLayers = false;
        app.findChangeTextOptions.includeLockedLayersForFind = false;
        app.findChangeTextOptions.includeLockedStoriesForFind = false;
        app.findChangeTextOptions.includeMasterPages = false;
        app.findChangeTextOptions.wholeWord = false;                             
        myFinds = myDoc.findText();
    return myFinds;

Here is a way you can find any field.
Download the current template.
Open it in word and go to the line that you are interested in.
The blanket PO# will be a field. Right click on it and go to properties. You will see the xml element there.
Hope this answers your question,
Sandeep Gandhi

Similar Messages

  • Create XML element without closing tag using Visual C++

    I know how to create xml element with closing tag (using WriteStartElement and WriteEndElement methods)
    <tag id="1234">
    </tag>
    but is there a way in Visual C++ to produce xml element like this
    <tag id="1234"/>
    i.e. without closing tag?

    Hi adamay,
    Please refer to this thread.
    http://stackoverflow.com/questions/8182245/create-xml-element-without-closing-tag-using-xslt
    I think you could try the way of write your own class derived from XmlWriter.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error While trying to Get XML element(tag) Values

    We are trying to get XML element (TAG) value from the XML pay load.
    Example.
    Getting XML String from a web service and then converting into XML payload.
    ora:parseEscapedXML(bpws:getVariableData('signOn_Out','signOnReturn'))
    From this XML payload we are trying to get an element (Tag) value.
    We are getting following error
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@118dc2a
    {http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Here are signOnReturn and XML Payload XSD's
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web1"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="Web1ProcessRequest">
              <complexType>
                   <sequence>
                        <element name="userName" type="string"/>
    <element name="password" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="Web1ProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
    </schema>
    <?xml version="1.0" encoding="windows-1252" ?>
    <schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Web"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="TProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
    <element name="User">
    <complexType>
                   <sequence>
                        <element name="Id" type="string"/>
    <element name="CompanyId" type="string"/>
    <element name="SecurityToken" type="string"/>
    <element name="FirstName" type="string"/>
    <element name="LastName" type="string"/>
    </sequence>
    </complexType>
    </element>
                   </sequence>
              </complexType>
         </element>
    </schema>

    I am sure and can see the data in audit trail.
    [2006/12/12 09:17:36]
    Updated variable "signOn_Output"
    - <signOn_Output>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <WebMethodsProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </WebMethodsProcessResponse>
    </part>
    </signOn_Output>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "tririga"
    - <tririga>
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </tririga>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Updated variable "Variable_2"
    - <Variable_2>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <TririgaProcessResponse xmlns="http://xmlns.oracle.com/WebMethods">
    <Result xmlns="">
    Success
    </Result>
    - <User xmlns="">
    <Id>
    2694069
    </Id>
    <CompanyId>
    208133
    </CompanyId>
    <SecurityToken>
    1165936654605
    </SecurityToken>
    <FirstName>
    Jagan
    </FirstName>
    <LastName>
    Rao
    </LastName>
    </User>
    </TririgaProcessResponse>
    </part>
    </Variable_2>
    Copy details to clipboard
    [2006/12/12 09:17:36]
    Error in evaluate <from> expression at line "130". The result is empty for the XPath expression : "/client:TririgaProcessResponse/client:User/client:LastName".
    oracle.xml.parser.v2.XMLElement@1c8768e
    Copy details to clipboard
    [2006/12/12 09:17:36]
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    - <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    - <part name="summary">
    <summary>
    empty variable/expression result.
    xpath variable/expression expression "/client:TririgaProcessResponse/client:User/client:LastName" is empty at line 130, when attempting reading/copying it.
    Please make sure the variable/expression result "/client:TririgaProcessResponse/client:User/client:LastName" is not empty.
    </summary>
    </part>
    </selectionFailure>
    Copy details to clipboard

  • How to refer ?XML element tag name? in the RTF variable

    Hi All,
    I want to declare variable and assign the value of XML element tag to that variable.
    Following are the steps:
    <?xdoxslt:set_variable($_XDOCTX, MYCOUNT,1)?>
    <?xdoxslt:get_variable($_XDOCTX, MYCOUNT)?>
    <?if: xdoxslt:get_variable($_XDOCTX, MYCOUNT) =1?>xxx<?end if?>
    In the declaration part,I need to replace 1 with some of the xml element tag value(for example : <?vendor_name?>).
    But when I try to do so,I get some list of exceptions.
    Please suggest how to proceed.
    Thanks and Regards,
    Kaveri

    Hi Pradeep,
    Thanks for your response.Here my requirement goes:
    for -each:
    text(database value)
    end for-each
    This text value will continue from page 1 to N.
    So for page1 I want HEADER1 and from page2 onwards,I require different header HEADR2.
    By using your approach,my text which needs to be continued on different pages will not be acheived.
    One more thing I got from XMLP User guide:
    <xdofo:inline-total
    display-condition="exceptfirst"
    name="InvAmt">.
    SInce all my tags are generated from Oracel reports,I am unable to use the above xml line.Is there any way to use this by modifying the syntax..
    Please let me know your suggestions since this is show stopper for my report.
    Thanks and Regards,
    Kaveri

  • XML element tag problem

    Hi guys,
    I am facing a problem in parseing a XML file when the element is in <element/> tag format. Iam using "javax.xml.parsers.SAXParser" to parse the XML. Basically XML contains many fields that are mandatary in my XSD. my requirement is that if there is a SAXParseException, I should get the name of the element for which the error is comming.
    What I am doing is, I am storing the name of the element in startElement method, which I print it in the catch block of the error. This code is working fine for <element></element> type of tag. But when the element tag is <element/> this. it does not go in the startElement or endElement block. Hence I always get the name element which is previous to the error element.
    How can I get the element name in both form of the element tag. As I have no control over the XML, which is posted on my servlet.

    I'm not sure why you're having a problem - the SAXException tells you where in the input stream the error is, and SAX parsers may report a validation error at any time so long as it is before passing the invalid element to the content handler. So it's legal for the exception to occur immediately after the startDocument, and will not necessarily occur immediately after the callback for the preceding element.
    Eg, if the DTD says you have <!ELEMENT foo (a,b,c,d)> and you have <foo><a/><b/><x/><d/></foo>, then the parser may well report the error before the startElement() call for the foo element, as it is invalid. Such fail-fast parser validation means you can safely update a persistant resource on receipt of the events, rather than having to wait until the element is closed before you are sure it's valid.
    This works fine for <element/> tag. But now there is a problem with <element></element> tag.Post the code you have, show how you are mapping from the line no. in the exception to the source data, and state which parser you are using.
    Pete

  • How to create XML element with out creating a document

    I ve been looking for hours for a method to create an XML element without the need for the Document. I am trying to create objects that access the database, and I need in each of these objects a method that returns only an element (ie. getXMLData()). And in the class that created these object, I nee to call the getXML() methods and construct a document. However, I am not looking to create the document if I am not going to use it. In the component class I need to be able to traverse the xml element and read and modify the values. Is there a way to do so with sun's JDK ?

    I ve been looking for hours for a method to create an
    XML element without the need for the Document.
    ... I am not looking to create the document if I
    am not going to use it.Hi M-A,
    Though you have been told the solution, let's stick to your original issue, just for the sake of interest. I gather what you have in mind is finding the answer to the following question: is there a way of creating a document without having to bind it to any data source? The answer is yes. What you might need is the createDocument() method of the DOMImplementation interface which offers lightwight document handling by obviating the need to construct a particular DOM instance. (You could also use the getDOMImplementation() method of the DOMImplementationRegistry interface, but it has bugs.) Here's a sample code:DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder parser = factory.newDocumentBuilder();
    DOMImplementation domImpl = parser.getDOMImplementation();
    Document doc = domImpl.createDocument(null, "rootnode", null);The above code produces the following document:<?xml version="1.0" encoding="UTF-8"?>
    <rootnode/>You can make this document even skinnier if you pass null values to all three parameters of the createDocument() method, in which case the document will only contain the prolog. I think both the creation and the structure of this document are simple enough for you to use it as some sort of utility (e.g. by putting the code in a separate class) for creating elements.

  • Create XML-element with different prefixes

    Hello,
    In Infopath 2010 I want to generate a XML-element with C#.
    I've got a XML-structure with following elements:
    /my:meineFelder/my:gruppe1/my:gruppe2/my:unter/my:art
    /my:meineFelder/my:gruppe1/my:gruppe2/ns1:FW1/MANDT
    To fill the field "art" I use this code:
    string myNamespace = NamespaceManager.LookupNamespace("my");
    writer.WriteStartElement("gruppe2", myNamespace);
      writer.WriteStartElement("unter", myNamespace);
        writer.WriteElementString("art", myNamespace, "lets go");
      writer.WriteEndElement();
    writer.WriteEndElement();
    writer.Close();
    This works very well.
    Problem: the code above do not work for the second field MANDT. Error: Error during Schema Validation.
    /my:meineFelder/my:gruppe1/my:gruppe2/ns1:FW1/MANDT
    I tried this:
     writer.WriteStartElement("ns1", "FW1", myNamespace);
            writer.WriteElementString("ns1", "MANDT", myNamespace, "100");
            writer.WriteEndElement();
    As you can see, the problem is ns1:FW1. How to fix it?
    Thank you very much!
    Regards,
    spadmin

    Hi,
    solved with:
    String xpath = "/my:xxx/my:gruppe1/my:gruppe2[last()]";
    XPathNavigator oldGroup = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager);
    XPathNavigator newGroup = oldGroup.Clone();
    oldGroup.InsertBefore(newGroup);
    Regards

  • Making XML elements (tags+attributes) visible in layout for PDF and print. Possible?

    Is it possible to have the XML structure (tags and attributes) be made visible and formatted in the layout? Such a hard-copy reference of the layout (a print and online Drupal publication) would make the XML visible to those persons writing/editing content but who are not using InDesign or XML viewing/editing programs. And this would improve workflow considerably. TIA

    Its the nextSibling of nxBook or, you may want to do it via
    an array:
    var xRootNode:XMLNode =xmlData.firstChild ;
    var xnBooks:XMLNode =xRootNode.childNodes;
    for (var j=0;j<xnBooks.length;j++) {
    var attrib:Object =xnBooks[j].attributes
    for (var sattrib:String in attrib ) {
    trace(attrib[sattrib]+ " " + sattrib);

  • How special characters can be used in xml element TAG.

    Hi,
    In my project data is fetched from the database and stored in the xml file. Data contains European characters as well. When I tried with UTF-8 it was giving error but when I changed the encoding to ISO-8859-1, XML generated.
    Well now I am stuck with a problem and as I don�t know much about XML, I am trying to get some knowledge from you.
    I have xml tag like: <Name&>Rohit</Name><employee#>78023</employee>.
    I am getting the error message �top level element must be defined.� This is because special characters are in TAG. But it doesn�t give error if I use special characters/European char in value( like Rohit*).
    I don�t know much about CDATA. Any help from your end will be greatly appreciated.Can this problem resolved if i use java function outformat.CDataElements(String[]) and pass the elements name.
    Thanks!!
    Regards,
    Rohit Dutt

    Client: I want this element name.
    You: The XML recommendation doesn't allow you to have that element name. If you make documents with that element name then no XML software will be able to read them. It just isn't going to work. Insisting on that would just be stupid and pointless. (Okay, you don't say that last sentence that way to your client but that's how it is. Explain it more nicely than that.)

  • Creating XML nested tags as output in XML files

    Hello:
    My question is a little extraordinary compared to most users since I am
    primarily concerned with the xml output that is generated when a form is
    submitted and emailed to a recipient.
    Can anyone tell me if it is possible to design a form that can generate an xml file containing nested XML tags using Designer? (See sample output below).
    Example:
                 PARTIAL
                 MONOCLONAL ANTIBODY
    Our company needs this type of nested code for input so we can paste it into a database field we are testing. I have other concerns but I'll defer these to another forum question.
    Regards.
    Harold

    [email protected] wrote:<br />> Thanks for the reply. That really helped! To build on this, I have another question which really gets to my dilemma.<br />> <br />> Is there a way to program a numeric text field to control the number of instances of a subform? For example, I would like to have a nested subform appear twice in the form if the user enters 2 in the numeric field. But more importantly, I would like to see its corresponding XML output appear like the following:<br />> <br />> <SUBUNIT_1><br />>    <LENGTH></LENGTH><br />>    <SEQUENCE><br />>        ELEESGGGLVQPGGRQSPEKGLETHYAE<br />>    </SEQUENCE><br />>    <N_TERMINAL>Yes</N_TERMINAL><br />>    <C_TERMINAL></C_TERMINAL><br />> </SUBUNIT_1><br />> <br />> <SUBUNIT_2><br />>    <LENGTH></LENGTH><br />>    <SEQUENCE><br />>        ELEESGGGLVQPGGRQSPEKGLETHYAE<br />>    </SEQUENCE><br />>    <N_TERMINAL>No</N_TERMINAL><br />>    <C_TERMINAL></C_TERMINAL><br />> </SUBUNIT_2><br />> <br />> If you pay close attention to the above code, you will see that I want the parent tag's ending digit incremented each time the subform is repeated. <SUBUNIT_1> <SUBUNIT_2> <SUBUNIT_3> ect . . .<br />> <br />> That is the twist! Is this programmatically possible?<br />> <br />> I might mention that the numeric field is not included as part of the subform. It is part of another subform.<br />> <br />> Regards.<br />> <br />> Harold<br /><br />I am going to respond to your question with another question.  Why do <br />you want to do it in this manner?  What you are trying to do is change <br />your XML schema on the fly.  In my opinion, this is not a good idea, <br />because the data is no longer consistent.  Couldn't you just add an <br />index attribute to your xml?  For example:<br />  <SUBUNIT><br />     <INDEX>1</INDEX><br />     <LENGTH></LENGTH><br />     <SEQUENCE><br />         ELEESGGGLVQPGGRQSPEKGLETHYAE<br />     </SEQUENCE><br />     <N_TERMINAL>Yes</N_TERMINAL><br />     <C_TERMINAL></C_TERMINAL><br />  </SUBUNIT><br />  <SUBUNIT><br />     <INDEX>2</INDEX><br />     <LENGTH></LENGTH><br />     <SEQUENCE><br />         ELEESGGGLVQPGGRQSPEKGLETHYAE<br />     </SEQUENCE><br />     <N_TERMINAL>No</N_TERMINAL><br />     <C_TERMINAL></C_TERMINAL><br />  </SUBUNIT><br /><br /><br />   Justin Klei<br />   Cardinal Solutions Group<br />   www.cardinalsolutions.com

  • [CS5 JS] Problem in Applying character styles xml tag names

    Hi,
    e.g. 1
    <italic>This is a italic text with <sup>superscript value</sup></italic>
    e.g.2
    <sup>This is a superscript text with <bold>Bold superscript</bold></sup>
    <italic>  mapped to character style "italic" and
    <sup> mapped to character style "sup"
    In my java script I already mapped the xml tags to specific character styles. In some of the cases (see e.g.1 and e.g.2) I need to map it to other character styles.
    In e.g.1 I need to apply a new character styles "italicSup" for the text "superscript value" same way
    In e.g.2 I need to apply a new character styles "BoldSup" for the text "Bold superscript".
    Can any know how to do this?
    Green4ever

    FYI, I am using
    Win Xp-SP2, CS5 7.0.3

  • Imported XSLT cannot create attributes for generated XML element

    I have two xslts. One imports the other.
    The imported xslt creates XML elements with attributes and this XML is stored in a variable in the main stylesheet
    If I perform the transformation with JRE prior to 1.6.0.18 then all works fine
    If I use 1.6.0.18 or 1.6.0.19 then the attributes aren't added.
    If I add attributes in the main xslt it works fine or if I output the element directly instead of first storing it in a variable then it also works fine.
    Problem seems to be when you try to add attributes from an imported stylesheet and store the generated element in a variable.
    Below two stylesheets to illustrate :
    First MainStylesheet.xsl
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Copyright 1993-2005 Seagull Software Systems, Inc. -->
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:exsl="http://exslt.org/common"
    extension-element-prefixes="exsl"
    exclude-result-prefixes="xs">
    <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" />
    <xsl:import href="innerstylesheet.xsl"/>
    <xsl:template match="/TestData">
    <xsl:variable name="generatedElementXml">
    <xsl:call-template name="generateElement">
    <xsl:with-param name="s">testValue</xsl:with-param>
    </xsl:call-template>
    </xsl:variable>
    <xsl:for-each select="exsl:node-set($generatedElementXml)">
    *** GeneratedElementXML {<xsl:text>
    </xsl:text><xsl:copy-of select="*"></xsl:copy-of>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>Next innerstylesheet.xsl
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:exsl="http://exslt.org/common"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    extension-element-prefixes="exsl" >
            <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
            <xsl:template name="generateElement">
                       <xsl:param name="s"/>
                    <TestElement testAttribute="$s" />
            </xsl:template>
    </xsl:stylesheet>The result output by jres before 1.6.0.18 is :
    <?xml version="1.0" encoding="UTF-8"?>
                   *** GeneratedElementXML {
              <TestElement xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" testAttribute="testValue"/>
                   }          The result output by jres since 1.6.0.18 is :
    <?xml version="1.0" encoding="UTF-8"?>
                   *** GeneratedElementXML {
              <TestElement xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                   }          Note : the 'testAttribute' attribute is missing

    Have found the difference in the code
    In both JRE1.6.0_17 & JRE1.6.0_18, the class 'com.sun.org.apache.xalan.internal.xsltc.dom.AdaptiveResultTreeImpl' has the following method
    public void addUniqueAttribute(String qName, String value, int flags)
            throws SAXException
            addAttribute(qName, value);
        }In JRE1.6.0_17 the next method is
    public void addAttribute(String name, String value)
         if (_openElementName != null) {
             _attributes.add(name, value);
         else {
             BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR, name);
        }In JRE1.6.0_18 the next method is
    public void addAttribute(String uri, String localName, String qname,
                String type, String value)
         if (_openElementName != null) {
             _attributes.addAttribute(uri, localName, qname, type, value);
         else {
             BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR, qname);
        }Note - the addAttribute method has additional parameters in JRE1.6.0_18 but the call from addUniqueAttribute wasn't updated.
    So in JRE1.6.0_18 addUniqueAttribute actually invokes the following method in the base package com.sun.org.apache.xml.internal.serializer.EmptySerializer
    public void addAttribute(String name, String value)
            aMethodIsCalled();
    void aMethodIsCalled()
            // throw new RuntimeException(err);
            return;
        }and as you can see this does nothing. Hence the fact that the attribute isn't added.

  • Map XML tag to an object style

    Hi everyone!
    I am not sure this is the correct place to post it, but i didn't find any "tagging" department of the forums.
    I do import some XML into ID document.
    Text nodes of my XML are imported properly, and i can map any tag of XML to one of the paragraph or table styles.
    But, when i import any images (or another ID documents) with <... href="..." />, how can i map that tag to an object style?
    ///////////// It would be very helpful for example when i'm going to set the stroke of 1pt to all of inline images of text frame.
    Please any feedback would be helpful.
    Alex.

    I will try to give an example, just to give a kick start ........... you need little bit of tweaking to meet your actual requirement:
    suppose you have an xml element "tag" having an attribute "@href" with object style name defined as  it's value. 
    <tag href="object_style_name">
    "object_style_name" is a object style and should exist in your document. To map the tag with the corresponding object style value you can use XMLRules in JS:
    //NOTE: NOT TESTED, BUT SHOULD WORK
    #include "glue code.jsx"
    main();
    function main(){
    if (app.documents.length != 0){
    var myDoc = app.activeDocument;
    var myRuleSet = new Array (
    new findObjAttribute("//*[@href]")
    with(myDoc){
    var elements = xmlElements;
    __processRuleSet(elements.item(0), myRuleSet);
    else{
    alert("You have no document open!");
    exit();
    function findObjAttribute(XPATH){
    this.name = "findObjAttribute";
    this.xpath = XPATH;
    this.apply = function(myElement, myRuleProcessor)
    //Just to check whether the collect element is selected
    var elmName=myElement.markupTag.name;
    var styleName=myElement.xmlAttributes.itemByName("href").value;
    with(myElement){
    try {
    applyObjectStyle(myDoc.objectStyles.item(styleName), true);
         } catch(e){};
    return true;
    HTH,
    Pankaj Chaturvedi

  • Finding MANUALLY applied character styles

    Hi all,
    We're in the process of switching to an XML workflow, and as one of our interim steps we're applying tags to paragraph and character styles in some of our documents. I'm aware of the option to map styles to tags and this should work well for paragraph styles. However, we're looking for a way to only map the character styles that have been manually applied.
    As an example, we have a paragraph style for instructions that has a bold number nested at the beginning of each paragraph. In other places, the same character style may be used to bold a specific word, but it is applied manually. Is it possible to map to tags ONLY the character styles that were applied manually? We do not want tags identifying character styles that were applied via Nested Styles or GREP Styles.
    I am assuming this would take some sort of script, which is why I'm posting in the scripting forum. Does anyone know if this is possible?
    Thanks in advance,
    Matthew

    Another InDesign oddity!
    If you fill a frame full of placeholder text and assign a "Bold" character style to, for example, a Nested Style:1 word, and a GREP style \<\w{4,6}\>, then use regular (or GREP) Find Text to search for the character style, it'll only highlight words that are at the start of the paragraph. Now that is wrong, wrong, wrong, because
    (a) it should not find any of them -- if you click your cursor into one of these bolded words, the Character Style panel says it's [None].
    or
    (b) it should find all of them, not just those that happen to be at the start of a paragraph. (BTW -- it's not the Nested Style it picks up; when using only GREP styles it'll also find words-at-the-start).
    It is funny, if things like this tickle you, that in a script "findText" works exactly the same. However: if you 'found' bold text and then interrogate what character style it has applied, it will only return your "bold" style if it was applied manually.
    See this script -- test with a placeholder text, aforementioned Nested/GREP styles, and a few hand-picked words that you applied "bold" to yourself. It will only report the ones you marked.
    app.findTextPreferences = null;
    app.findTextPreferences.appliedCharacterStyle = "bold";
    list = app.activeDocument.findText();
    r = [];
    while (list.length)
         next = list.pop();
         if (next.appliedCharacterStyle == app.activeDocument.characterStyles.item("bold"))
              r.push (next.contents);
    alert (r.join("\r"));

  • XML Elements Ordering in Generated XML Output

    I have a requirement where I need the xml element tags to appear in the generated xml output in the same order as in data template definition but in my case this is not happening. I have one master group - Customer and two subgroups - BillingAddress and ShipToAddress. The subgroups appear below some master elements eg. Contact but above other master elements eg. Telephone . However when the xml output is finally generated all the Master Elements appear first followed by the subgroup elements. Does anyone know how I can rectify this?
    See below:
    my data template structure is as follows:
    - <group name="Customer" dataType="varchar2" source="Q_MASTER_FILE_CUST">
    <element name="CustomerID" datatype="varchar2" value="CUSTOMER_NUM" />
    <element name="CustomerTaxID" datatype="varchar2" value="TAXPAYER_ID" />
    <element name="CompanyName" datatype="varchar2" value="COMPANY_NAME1" />
    <element name="Contact" datatype="varchar2" value="CONTACT_NAME" />
    - <group name="BillingAddress" dataType="varchar2" source="Q_MF_CUST_BILLTO">
    <element name="BuildingNumber" datatype="varchar2" value="BUILD_NUM1" />
    <element name="StreetName" datatype="varchar2" value="STREET_NAME1" />
    <element name="AddressDetail" datatype="varchar2" value="ADDRESS_STYLE1" />
    <element name="City" datatype="varchar2" value="CITY1" />
    <element name="PostalCode" datatype="varchar2" value="POSTAL_CODE1" />
    <element name="Region" datatype="varchar2" value="COUNTY1" />
    <element name="Country" datatype="varchar2" value="COUNTRY1" />
    </group>
    - <group name="ShipToAddress" dataType="varchar2" source="Q_MF_CUST_SHIPTO">
    <element name="BuildingNumber" datatype="varchar2" value="BUILD_NUM2" />
    <element name="StreetName" datatype="varchar2" value="STREET_NAME2" />
    <element name="AddressDetail" datatype="varchar2" value="ADDRESS_STYLE2" />
    <element name="City" datatype="varchar2" value="CITY2" />
    <element name="PostalCode" datatype="varchar2" value="POSTAL_CODE2" />
    <element name="Region" datatype="varchar2" value="COUNTY2" />
    <element name="Country" datatype="varchar2" value="COUNTRY2" />
    </group>
    <element name="Telephone" datatype="varchar2" value="PHONE_NUMBER" />
    <element name="Fax" datatype="varchar2" value="FAX1" />
    <element name="Email" datatype="varchar2" value="EMAIL_ADDRESS" />
    <element name="WebSite" datatype="varchar2" value="URL" />
    </group>
    </group>
    My XML Output is as follows:
    <Customer>
    <CustomerID>1000</CustomerID>
    <CustomerTaxID>65-94238654</CustomerTaxID>
    <CompanyName>World of Business</CompanyName>
    <Contact>MS. Jolene Smith-Kelly</Contact>
    <Telephone>8441212</Telephone>
    <Fax />
    <Email />
    <WebSite />
    - <BillingAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </BillingAddress>
    - <ShipToAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </ShipToAddress>
    </Customer>
    It should be as follows:
    <Customer>
    <CustomerID>1000</CustomerID>
    <CustomerTaxID>65-94238654</CustomerTaxID>
    <CompanyName>World of Business</CompanyName>
    <Contact>MS. Jolene Smith-Kelly</Contact>
    - <BillingAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </BillingAddress>
    - <ShipToAddress>
    <BuildingNumber />
    <StreetName />
    <AddressDetail />
    <City>San Jose</City>
    <PostalCode>95053</PostalCode>
    <Region>Santa Clara</Region>
    <Country>US</Country>
    </ShipToAddress>
    <Telephone>8441212</Telephone>
    <Fax />
    <Email />
    <WebSite />
    </Customer>
    is anyone able to advise?
    Rani

    If you know the changes necessary then you could write an XSL transformation to do them. But a generalized piece of code that examined an XML document and a schema, then produced a corrected document, would be quite difficult to write.

Maybe you are looking for

  • Onscreen (Popup) notifications when connection is made to internet

    Can anyone please tell me how to disable the onscreen "popup" type notifications that the Linksys system displays each time the router makes a connection to the internet?  These notifications are very, very annoying and always come on and block out s

  • Please help. my images/web page not displaying ( just outlines) when checking in my browser

    Hi. I am using an old dreamweaver. thats not the problem. I view my web site in browser to check all ok. When i click my link to next page, it will open it in new window as it should do, but displays no images (apart from my email link) just outlines

  • Win Server 2012 Failover Cluster - Error: Failed to bring cluster disk online

    Hi Technet I'm currently running running 2 VMs Win Server 2012 and would like to test Failover Clustering for one of our FTP server I've added on both servers an additional partition, formatted and Online One of the drives comes Online but cannot bri

  • XMLConcat bug?

    I have encountered (for me) confusing behaviour with the XMLCONCAT function. See below a simplified code snippet: declare l_return xmltype; begin select xmlconcat(xmlelement("x:y",dummy), xmlelement("x:z", dummy)) into l_return from dual; dbms_output

  • Cobol XI Integration

    Hello , Anyone out there done a Cobol app to R3 integration using XI ? Need some recommendations. Consultants welcome. Thanks in advance. Kiran