[JS][CS6] ParagraphStyles to XML Tags

Hello!
I need to create a XML structure based on Paragraph Styles of the entire document.
I'm trying to create this structure:
<Root>
<hlhead>
<hlhead>Example Paragraph</hlhead>
<hlbullet>Bullet Paragraph 1</hlbullet>
<hlbullet>Bullet Paragraph 2</hlbullet>
So on...
</hlhead>
So on...
</Root>
Notes:
- The tags needs to be different from paragraph style, so I'm reading the name of style to apply/create the tag.
- The paragraph needs to be linked to tag too, for future XML import.
Here's a example code of I'm trying to do:
for(var i=0; i<=myPageItems.length; i++) { // Loop for the all document items
     var myTextFrame = myPageItems[i];
     if(myTextFrame instanceof TextFrame){ // Works on textframes only
           var myParagraphs = myTextFrame.paragraphs; // Get the textframe paragraphs
           for(var j=0; j<myParagraphs.length; j++) { // Loop for textframe paragraphs
               // Debug
               myParagraphs[j].select();
               alert("Item: "+ myPageItems[i] +"\n"
                    + "Paragraphs: "+ myParagraphs.length +"\n"
                    + "ParagraphStyle: "+ myParagraphs[j].appliedParagraphStyle.name +"\n"
                    + "Text: "+ myParagraphs[j].contents +"\n"
                    + "xmlElem: "+ xmlElem +"\n"
               // EndDebug
               if(myParagraphs[j].appliedParagraphStyle.name == "3A hl head"){ // Check for ParagraphStyle
                    var xmlBody = xmlRoot.xmlElements.add({markupTag:"hlhead"}); // Add the parent element
                    var xmlElem = myParagraphs[j].markup( xmlBody.xmlElements.add({markupTag:"hlhead"}) ); // <- Error
                    //xmlElem.contents = myParagraphs[j].contents; // Put the content, but without links... unused
               else if(myParagraphs[j].appliedParagraphStyle.name == "3D hl bullet"){
                    myParagraphs[j].markup( xmlBody.xmlElements.add({markupTag:"hlbullet"}) );
               // Another else ifs
I'm getting error in this part:
var xmlElem = myParagraphs[j].markup( xmlBody.xmlElements.add({markupTag:"hlhead"}) );
Apparently the error is in "myParagraphs[j].markup" (because it "works" if removed), but the Paragraph Object have the markup method... I guess.
What do I need to do?
Can anybody help me on this, please?
Thanks!

Sorry for my... triple post, haha.
Yay, I did it!
Here's the code for future references:
#target indesign
myDoc = app.activeDocument;
myPageItems = myDoc.allPageItems;
xmlRoot = myDoc.xmlElements.item("Root");
createXML();
function createXML() {
          for(var i=0; i<=myPageItems.length; i++) {
                    var myTextFrame = myPageItems[i];
                    if(myTextFrame instanceof TextFrame){
                              var myParagraphs = myTextFrame.paragraphs;
                              for(var j=0; j<myParagraphs.length; j++) {
                                        // Debug
                                        alert("Item: "+ myPageItems[i] +"\n"
                                                  + "Paragraphs: "+ myParagraphs.length +"\n"
                                                  + "ParagraphStyle: "+ myParagraphs[j].appliedParagraphStyle.name +"\n"
                                                  + "Text: "+ myParagraphs[j].contents +"\n"
                                                  + "parent: "+ myParagraphs[j].parent +"\n"
                                        // EndDebug
                                        myParagraphs[j].select();
                                        selection = app.selection[0];
                                        if(myParagraphs[j].appliedParagraphStyle.name == "3A hl head"){
                                                  xmlRoot.xmlElements.add({markupTag:"hlhead", xmlContent:selection});
                                                  myParagraphs[j].parent.markup( xmlRoot.xmlElements.add({markupTag:"hlhead"}) );
                                        else if(myParagraphs[j].appliedParagraphStyle.name == "3D hl bullet")
                                                  xmlRoot.xmlElements.add({markupTag:"hlbullet", xmlContent:selection});
                                        else if(myParagraphs[j].appliedParagraphStyle.name == "3D hl bullet(last)")
                                                  xmlRoot.xmlElements.add({markupTag:"hlbulletlast", xmlContent:selection});
                                        // So on...
Thanks!
PS: My first js code!

Similar Messages

  • How can I add text to a field based on XML tagging?

    I'm fairly new to using XML in InDesign layouts, and I'm currently facing an issue getting a bunch of content from database records formatted in a print document (text that flows over dozens of pages). I've figured out how to create an InDesign template, but I need to be able to add text between some of the XML elements in two different scenarios:
    1. Add text or line breaks before or after an XML element that always appears in the document. For example: Adding "Description:" before the XML-tagged description content, or adding a return after the last element in a list.
    2. Add text before or after an XML element only if it appears in the document. For example: If there's a second phone number, tagged "Phone2" in the XML, then I want " or " to appear before it in the layout. Otherwise there's just one phone number and it continues on to the next piece of content.
    I have tried inserting this text into the InDesign template, but keeping them means having to also keep parts of the template that aren't used on every import--so I have a bunch of "or Phone2" bits of text to find and replace afterward. That's OK, but I'd like a more elegant solution that doesn't leave potential mistakes in my layout.
    In my preliminary research so far, it looks like an XSLT or scripting might be able to handle this, but I don't know where to start. Can someone tell me if what I'm looking for is possible and suggest the best way to do it? I'm going to have to trial-and-error a solution for this myself.
    I am using ID CS6 on a Mac. Thanks in advance for your help.

    Thanks for your reply. The line that you mention is added at the top of the message, and includes the original sender's email. I would like my name to appear, next to each line I add in the text of the original mail.
    For example:
    Assuming my name is Joe Smith, what I would like to have as the final reply is described below.
    The lines that start with "[Joe Smith]" are my replies, to the original items in the original mail.
    On 21 Feb 2013, at 09:03, Jon Doe wrote:
    We need an effort estimation for thenew feature
    [Joe Smith] It will be about 2 days
    and additional resources needed
    [Joe Smith] 2 new icons

  • InDesign crashes when I add xml tag

    I have some groups (image + text) inside text.
    When I try to add xml tags with a grep query InDesign crashes.
    If I try to manually add xml tag to the text in a group, for example "evitare l'umidità", InDesign give me a message error.
    I think it's a bug
    Here there is the document Dropbox - ProblemaTag.idml
    Thanks
    Ivan

    I haven't done a Book in CS6 yet, but I'm starting to wonder if there might be some sort of bug (not extremely likely, but....) that's new. We had another post yesterday where ID crashed when trying to move a particular file into the chapter 5 position.
    Can you add this file first, then move it to the correct spot after the other files are added?

  • Renaming XML tags via Javascript

    I currently have a script that finds certain paragraph styles and renames them. For example:
    var myDoc=app.activeDocument;
          var myStyle=myDoc.paragraphStyles.itemByName("SIDEBAR B HEAD");
          myStyle.name="SIDEBAR RATING HEAD"
    I'd like to do the same thing with some XML tag names, preferably as part of the same script. I'm sure it's fairly easy, but for some reason I can't find any info on how to call out XML tags!
    I've looked through the InDesign CS4 Scripting Tutorial and Adobe Introduction to Scripting, but at this point I feel like I'm wasting my time on a simple problem. Can anyone help out an amateur?
    Thanks in advance,
    Matt

    Or
    You can use this function for multiple rename tag
    var myDoc = app.activeDocument;
    RenamXMLTag("Old", "New");
    RenamXMLTag("Old", "New");
    function RenamXMLTag(Old, New)
         if(myDoc.xmlTags.itemByName(Old).isValid)
         myDoc.xmlTags.itemByName(Old).name = New;
    Shonky

  • Alert Content for text without any XML tag

    Hi All,
    For the XML workflow,
    Need a alert content or select content for the text without any xml tag.
    Please help for my XML job request.
    Regards
    Siraj

    Hi All,
    New to XML, just learning stage only.
    Already I asked and got the coding through forum. It alert text frame ID only.
    But, guide me how to get the
    1. alert or select the contents.
    2. alert the page number or select text frame etc.
    Coding is below:
    #target InDesign
    #include "/Applications/Adobe InDesign CS6/Scripts/Xml Rules/glue code.jsx"
    main();
    exit();
    function main() {
              var myDoc = app.activeDocument;
              var myStories = myDoc.stories.everyItem().getElements();
              var idArray = new Array(0);
              var storyArray = new Array(0);
              // store all stories of the document in an array
              for(var j=0; j < myStories.length; j++) {
                        storyArray.push(myStories[j].id);
    // *** here start the XML-Rules ******************************//
              var elements = myDoc.xmlElements;
              var myRuleSet = new Array(
                        alleObj = new all(idArray)
              __processRuleSet(elements.item(0), myRuleSet);
    // *** here stop the XML-Rules *******************************//
              for (var i=0; i < idArray.length; i++) {
                        for (var k=0; k < storyArray.length; k++) {
                                  if (idArray[i] == storyArray[k]) {
                                            storyArray[k] = -1;
              for (var i=0; i < storyArray.length; i++) {
                        if (storyArray[i] > 0) {
                                  alert(storyArray[i]);
                        }          // if …
              }          // for()
    }          // main()
    // XML-Rule
    function all(idArray) {
              this.name = "all";
              this.xpath = "//*";
              this.apply = function(myElement, myRuleProcessor) {
                var storyId = myElement.parentStory.id;
                        var i=0, found = false;
                        while ((i < idArray.length) && (!found)) {
                                  if (idArray[i++] == storyId) found=true;
                        // store anly the number of the stories which are not stored up to now
                        if (!found) idArray.push(storyId);
                return true;
              }          // this.apply
    }          // all()
    Regards
    Siraj

  • Assign paragraph-styles to xml-tags correctly. How to?

    Hi,
    I want to assign xml-tags to existing paragraph styles in InDesign CS6 on a Mac 10.6.8. The xml itself is organized like this:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <katalog>
    <artikel id="32434">
    <img href="/bilder/32434.tiff" />
    <artikeltextgruppe>
    <artikelmarke>DieselGabana</artikelmarke>
    <artikelheadline>Jeans ist super</artikelheadline>
    <artikeltext>Superjeans knallt rein.</artikeltext><artikelnummer>70238</artikelnummer>
    <artikelmaterial>100% Jeans</artikelmaterial>
    <artikelgroesse>Uni</artikelgroesse>
    <artikelfarbe>Uni</artikelfarbe>
    </artikeltextgruppe>
    </artikel>
    </katalog>
    By selecting the option "Assign formats per name to the tags" (translated from German) I wanted to generate the desired look. But if I start this all I get is the whole textblock of <artikeltextgruppe> assigned to 1 formatstyle. And besides that the whole content of <artikeltextgruppe> looks like one single paragraph without any structure (no linebreaks) The content though is correctly structured because I can highlight the value of e.g. <artikelmarke>separately by doubleclicking this tag in the structure-view.
    a) What can I do to assign the formats correctly AND to have correct linebreaks?
    b) If I drag my node <img href="/bilder/32434.tiff" /> iin the layout I get a message displayed to search again for the correct reference location. And that happens independently on using relative or absolute references (Although I need to use relative ones) What can I do here?
    thanks so much

    First, I would probably do a search and replace to remove the group element using a text editor (the <artikeltextgruppe> and </artikeltextgruppe> elements). They really are not needed.
    Second, I usually create my styles with the same names as the elements themselves. Then, after the XML is imported, I use the "map tags to styles" command from the Structure pane.
    I copied and pasted the single artikel element to create 4 records, added a varition of an image to each element record. Once the paragraph styles were mapped, your XML looked like this in a two column format (to get all 4 records on a page)...
    By default, ID will create a single line to a single line in the XML. So if you desire elements to be on their own line, the XML needs to be formatted that way. If you need different styling within a paragraph, you need to create character styles and alter the elements within an XML group and or paragraph and add the code in the XML accordingly or post process once inside of ID.
    I always need to take the XML I am given and reformat, move elements with the tree, change links to images, remove tabs and or spaces where I do not want them, tag for character styles, etc., to get close to how I want the initial format to be.
    Mike

  • Script to map xml tags to para styles

    I am using the 'FindChangeByList.jsx' to format a series of text files.
    I realise that I can map tags to styles using the 'Tags" palette.
    But I wondered, if it is possible, if someone would be able to show me the syntax to include in my list (.txt file) to map xml tags to paragraph styles assigned in the list as it runs the script?
    Steve

    If you want through find and change here below is a function for apply tag on paragraph style
    var myDoc = app.activeDocument;
    addtags("A Head", "Head");
    addtags("Text", "P");
    function addtags(stylename, tag)
    if(myDoc.paragraphStyles.item(stylename) != null)
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.findWhat = '.+';
    app.findGrepPreferences.appliedParagraphStyle = stylename;
    app.changeGrepPreferences.markupTag = tag;
    myDoc.changeGrep();
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    Shonky

  • Attaching XML tags to paragraphs (CS2/VB)

    Hi everybody,
    I need to build an Indesign document from several Word documents, attach XML tags to those document parts and also to retain Word's paragraph styles.
    I use temporary textframes and copy & paste to put the Word stuff together into one large textframe. Works fine so far. Paragraph styles remain intact:
    InDesign.XMLElement xch = root.XMLElements.Add("XML_" + Convert.ToString(cnt), "");
    InDesign.InsertionPoint ip = (InDesign.InsertionPoint)txt.InsertionPoints.LastItem();
    ip.Select(InDesign.idSelectionOptions.idReplaceWith);
    id4.app.Paste();
    But as soon as I call Markup() to add the XML tag to this part of the document, all paragraph style information gets lost:
    ip.Markup(xch);
    This is most certainly some kind of RTFM error, but since there's no really detailed documentation for scripting (at least I couldn't find one yet - hints are welcome), I'm stuck.
    Thanks a lot.
    Hans

    Hi Hans,
    The InDesign CS2 Scripting Guide and Scripting Reference PDFs are on your InDesign CS2 installation CDs.
    Many things in scripting did not change between CS2 and CS3--and there are more XML examples in the CS3 version of the Guide (though you should note that CS2 does not have the XML rules feature at all). You can find the InDesign CS3 Scripting Guide: VBScript at:
    http://www.adobe.com/products/indesign/xml_scripting.html
    (you'll need to click the Scripting Resources tab to get to the relevant page)
    The Markup.vbs example script (a fragment is shown on page 119 of the Guide; you can find the full script in the associated Zip archive of scripts) shows you the general approach to marking up page items or text. The basic form is:
    Rem Where "myXMLElement" is a reference to an XML element
    Rem and "myText" is a reference to a text object...
    myXMLElement.markup myText
    Here's a more complete script (VBScript form):
    Rem MarkupText.vbs
    Rem An InDesign CS2/CS3 VBScript
    Rem
    main
    Function main()
    Rem Use "InDesign.Application.CS2" to target CS2
    Set myInDesign = CreateObject("InDesign.Application.CS3")
    mySetup myInDesign
    mySnippet myInDesign
    End Function
    Rem mySetup function creates an example document.
    Function mySetup(myInDesign)
    Set myDocument = myInDesign.Documents.Add
    Rem Create some paragraph styles.
    Set myBodyText = myDocument.ParagraphStyles.Add
    myBodyText.Name = "BodyText"
    Set myHeading = myDocument.ParagraphStyles.Add
    myHeading.Name = "Heading"
    myHeading.PointSize = 24
    Rem Add XML elements
    Set myRootXMLElement = myDocument.XMLElements.Item(1)
    Set myXMLTag = myDocument.XMLTags.Add("xml_element")
    Set myXMLElementA = myRootXMLElement.XMLElements.Add(myXMLTag)
    Rem Create a text frame
    Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
    myTextFrame.GeometricBounds = myGetBounds(myDocument,myDocument.Pages.Item(1))
    myString = "This is the first paragraph in a text frame." & vbCr
    myString = myString & "This is the second paragraph in a text frame." & vbCr
      myString = myString & "This is the third paragraph in a text frame." & vbCr
      myString = myString & "This is the fourth paragraph in a text frame." & vbCr
    myTextFrame.Contents = myString
    Rem Use ApplyParagraphStyle in CS3.
    myTextFrame.Texts.Item(1).ApplyStyle myBodyText
    myTextFrame.Paragraphs.Item(1).ApplyStyle myHeading
    End Function
    Rem mySnippet shows how to use the XMLElement.Markup method.
    Function mySnippet(myInDesign)
    Set myDocument = myInDesign.Documents.Item(1)
    Rem Have to associate the Root XML element with the story
    Rem before associating child elements.
    myDocument.XMLElements.Item(1).Markup myDocument.Pages.Item(1).TextFrames.Item(1)
    Rem Now we can associate XML elements with individual paragraphs.
    Set myXMLElement = myDocument.XMLElements.Item(1).XMLElements.Item(1)
    Set myText = myDocument.Pages.Item(1).TextFrames.Item(1).Paragraphs.Item(1)
    myXMLElement.Markup myText
    End Function
    Rem Utility function for getting the bounds of the "live" area
    Rem (the area inside the page margins) of a page.
    Function myGetBounds(myDocument, myPage)
    myPageWidth = myDocument.DocumentPreferences.PageWidth
    myPageHeight = myDocument.DocumentPreferences.PageHeight
    Rem Page.Side is a CS3 property. In CS2, use:
    Rem If myPage.DocumentOffset Mod 2 = 0 Then
    If myPage.Side = idPageSideOptions.idLeftHand Then
      myX2 = myPage.MarginPreferences.Left
      myX1 = myPage.MarginPreferences.Right
    Else
      myX1 = myPage.MarginPreferences.Left
      myX2 = myPage.MarginPreferences.Right
    End If
    myY1 = myPage.MarginPreferences.Top
    myX2 = myPageWidth - myX2
    myY2 = myPageHeight - myPage.MarginPreferences.Bottom
    myGetBounds = Array(myY1, myX1, myY2, myX2)
    End Function
    As to style information getting lost--it probably has to do with your Tag to Style/Style to Tag mapping. The above script demonstrates that it is possible to mark up text without losing the style.
    You might also consider using tag to style or style to tag mapping after pasting the text from Word.
    Hope this helps!
    Thanks,
    Ole

  • XML tag markers moved: Find and Replace causing problem in xml elements

    Hi All,
    I am doing find and replace using GREP. While using the expression like $1, $2 (Found Items) in the change to field it changes the placement of tag marker. If the found item is a part of two of more xml elements, I am getting a serious problem while replacing it. (ie. The xml tag markers are moved.)
    See the screen shot below, then you may get better idea. And help me to overcome this issue.
    This is just an example to show you what i'm trying to say, there are so many cases like this.
    Original text/ Before doing find replace
    After replacing
    Green4ever

    Hi Peter and John,
    but it seems to me that the example is looking for any space that
    follows a semi-colon and has two word characters following it, and
    repalce that with an em space. I think you could do the same using look
    behind and look ahead and not need to replace the found text.
    Yes you are right about the look behind and look ahead. I'd like to show some more examples to show what the actual problem is,
    Original/Before Replacing,
    (Consider there is another case here, instead of em-space some times normal word space will also be there)
    Using the Grep:
    Find What---------> ^(\d+\.(?:\d+)?)~m
    Change To------------->$1\t
    After Replace:
    Did I make any sense? Eventhough this will not make any changes in the layout, my requirement is to insert the tab out-side the tag marker not indise.
    Green4ever

  • Urgent help needed for XML Tags using XMLForest()

    Folks
    I need some urgent help regarding getting use defined tag in your
    XML output.
    For this I am using XMLElement and XMLForest which seems to work fine
    when used at the SQL prompt but when used in a procedure throws and error
    SQL> Select SYS_XMLAGG(XMLElement("SDI",
                                       XMLForest(sdi_num)))
         From sdi
         where sdi_num = 22261;- WORKS FINE
    But when used in a procedure,doesnt seem to work
    Declare
        queryCtx  DBMS_XMLQuery.ctxType;
        v_xml     VARCHAR2(32767);
        v_xmlClob CLOB;
        BEGIN
        v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
                                             XMLFOREST(sdi_num)))
        From sdi
        where sdi_num = 22261';
        queryCtx :=DBMS_XMLQuery.newContext(v_xml);
        v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
        display_xml(v_xmlClob);
    End;
    CREATE OR REPLACE PROCEDURE  display_xml(result IN OUT NOCOPY CLOB)
    AS
         xmlstr varchar2(32767);
         line varchar2(2000);
    BEGIN
         xmlstr:=dbms_lob.SUBSTR(result,32767);
         LOOP
         EXIT WHEN xmlstr is null;
         line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
         dbms_output.put_line('.'||line);
         xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
         END LOOP;
    end;
    SQL> /
    .<?xml version = '1.0'?>
    .<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
    XML tag name.</ERROR>
    PL/SQL procedure successfully completed.
    SQL>HELP is appreciated as to where I am going wrong?

    Hi,
    if you want to transform something to something else, you should declare, what is your source.
    I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
    Kind regards,
    Hendrik

  • Error for fetching long text in xml tag for xml publisher report

    My requirement is to fetch a large document which is in text format in XML output which can be printed in PDF format by using RTF method to generate PDF.But during XML ouput i got the following error-
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh
    button, or try again later.
    The following tags were not closed: XXBG_EAMWRREP_V1, LIST_G_WO_ACTIVITY_CODE, G_WO_ACTIVITY_CODE, LIST_G_MEDIA_ID1,
    G_MEDIA...
    XXBG_EAMWRREP_V1 is the rdf and LIST_G_WO_ACTIVITY_CODE, G_WO_ACTIVITY_CODE, LIST_G_MEDIA_ID1, G_MEDIA are the groups name. In the group
    G_MEDIA i am fetching long_text from attahcment in application. In Database table the datatype of the text attachment is 'long' and there is a huge text
    data loaded in large data editor of that column. If the text data volume is small enough then there is no problem for fetching the xml output.
    If we change the output format as HTMl then there is no problem for fetching the output for long text but for xml output format we are unable to fetch the data
    in xml tag.
    One thing to mention the oracle report is the copy of Maintenance Work Order Detail Report. The seeded report is HTML format in 11i. The requirement is to make it in xml report.
    Please help.

    Hi,
    Actually clob datatype is not available in oracle report builder datatype lov. Could you pls tell the other ways of converting that to clob in oracle report...

  • XML tags in an "export : XML" Report Template

    Hi All,
    I'm using the export XML report template to produce XML from a query. One of the column contains XML tags and the template is translating eg: if the column is "Groups" then I get:
    <Groups>& lt ;Group& gt ;Sales & lt ;/Group & gt ; & lt ;Group& gt ;IT& lt ;/Group& gt ;</Groups>(ignoring all the spaces - OTN is translating the & gt 's :)
    instead of:
    <Groups><Group>Sales<Group><Group>IT</Group></Groups>Is there an easy way to stop this ?
    Thanks,
    Steve
    Edited by: spilgrim on Mar 6, 2009 12:14 PM
    Edited by: spilgrim on Mar 6, 2009 12:14 PM

    Hi Steve,
    Did you ever solve this? I'm having a similar issue while trying to build a Report Query that I want to build with nested elements.
    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
    - &lt;ROWSET&gt;
    - &lt;ROW&gt;
    &lt;EE_ID&gt;467&lt;/EE_ID&gt;
    &lt;EE_GRIDS&gt;
    &lt;EE_GRID INDEX="1"&gt;
    &lt;EE_INCENTIVE_CASH_PROGRAM&gt;MIP&lt;/EE_INCENTIVE_CASH_PROGRAM&gt;
    &lt;EE_BONUS&gt;20&lt;/EE_BONUS&gt;
    &lt;/EE_GRID&gt;
    &lt;EE_GRID INDEX="2"&gt;
    &lt;EE_INCENTIVE_CASH_PROGRAM&gt;VIP&lt;/EE_INCENTIVE_CASH_PROGRAM&gt;
    &lt;EE_BONUS&gt;30&lt;/EE_BONUS&gt;
    &lt;/EE_GRID&gt;
    &lt;/EE_GRIDS&gt;
    &lt;/ROW&gt;
    - &lt;ROW&gt;
    &lt;EE_ID&gt;468&lt;/EE_ID&gt;
    &lt;EE_GRIDS&gt;
    &lt;EE_GRID INDEX="1"&gt;
    &lt;EE_INCENTIVE_CASH_PROGRAM&gt;MIP&lt;/EE_INCENTIVE_CASH_PROGRAM&gt;
    &lt;EE_BONUS&gt;20&lt;/EE_BONUS&gt;
    &lt;/EE_GRID&gt;
    &lt;EE_GRID INDEX="2"&gt;
    &lt;EE_INCENTIVE_CASH_PROGRAM&gt;VIP&lt;/EE_INCENTIVE_CASH_PROGRAM&gt;
    &lt;EE_BONUS&gt;30&lt;/EE_BONUS&gt;
    &lt;/EE_GRID&gt;
    &lt;/EE_GRIDS&gt;
    &lt;/ROW&gt;
    &lt;/ROWSET&gt;
    Thanks
    Keith
    Edited by: kmatthew on Mar 17, 2009 2:44 PM

  • Problem trying to wrap a Microsoft Word paragraph in XML tags?!? :/

    Hello everyone. I really hope this is not a big problem and that some of your could help. I wrote a Macro in VBA like a year ago that was intented to put a tag before every single paragraph in a document. The logic validates that the paragraph have no other
    tag before putting one. All of this is based in styles. Some font styles would end up with different tags. This is my code and it works:
    Sub edictos()
    ' Edictos de El Nuevo Día
    ' 06/20/2005 by Carlos Stella Sistemas de Información
    ' Actualización 08/08/2012
    'Ver 2.0 made by Samuel Otero -> 07/26/2013
    Dim oPara As Paragraph
    Dim oRng As Range
    'Borramos headers y footers
    Call ClearHeaderFooters
    'Borramos column breaks
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = "^n"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    'Lógica para poner los tags de Tera donde van
    For Each oPara In ActiveDocument.Paragraphs
    If oPara.Range.Style = "C10" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(intro) "
    End If
    End If
    If oPara.Range.Style = "J10" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(intro) "
    End If
    End If
    If oPara.Range.Style = "J12" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(intro) "
    End If
    End If
    If oPara.Range.Style = "LE" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    If oPara.Range.Style = "XL" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    If oPara.Range.Style = "MF" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    If oPara.Range.Style = "HG" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    If oPara.Range.Style = "LW" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    If oPara.Range.Style = "J8" Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    ' Agarrando texto sin estilo >_>
    If oPara.Range.Font.Size <= 6 Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(main) "
    End If
    End If
    If oPara.Range.Font.Size = 8 Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(capara) "
    oPara.Range.InsertParagraphBefore
    oPara.Range.InsertBefore "(start) "
    End If
    End If
    If oPara.Range.Font.Size = 10 Then
    If InStr(1, oPara.Range.Text, "(intro)") = 0 And _
    InStr(1, oPara.Range.Text, "(main)") = 0 And _
    InStr(1, oPara.Range.Text, "(capara)") = 0 Then
    oPara.Range.InsertBefore "(intro) "
    End If
    End If
    Next oPara
    'Con esto borramos el primer espacio del documento (evitamos una línea demás en los edictos)
    Selection.HomeKey Unit:=wdStory
    Selection.MoveDown Unit:=wdLine, Count:=2
    Selection.MoveRight Unit:=wdCharacter, Count:=8
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    Selection.TypeBackspace
    'Crea el .txt para ser importado a Tera
    ChangeFileOpenDirectory "C:\edictos\"
    ActiveDocument.SaveAs FileName:="C:\edictos\Edictos.txt", FileFormat:= _
    wdFormatText, AddToRecentFiles:=True, _
    WritePassword:="", EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
    False, Encoding:=1252, InsertLineBreaks:=False, AllowSubstitutions:=False, _
    LineEnding:=wdCRLF
    MsgBox "Proceso completado", 0, "Yay!"
    ActiveDocument.Close
    End Sub
    As you see, it ends up saving a .txt document with the tags.
    NOW... the issue is that the tags wont work anymore in the new system, and I need to wrap the paragraph in XML Tags. I tried to do something like for styles:
    If oPara.Range.Style = "LW" Then
    If InStr(1, oPara.Range.Text, "<intro>") = 0 And _
    InStr(1, oPara.Range.Text, "<main>") = 0 And _
    InStr(1, oPara.Range.Text, "<capara>") = 0 Then
    oPara.Range.InsertAfter "</main> "
    oPara.Range.InsertBefore "<main> "
    End If
    End If
    But it just would add the two tags before the paragraphs!!! Is there anyway to wrap the paragraph in XML tags, following my logic? Somebody help please!! Thank you!! :/

    Hi,
    Sorry for my delay.
    I am afraid that this is not the proper forum for this issue, and I found that you have posted it in dedicated forum.
    http://social.msdn.microsoft.com/Forums/office/en-US/8dad5670-d90b-4ea8-abe2-bc785a2368ca/problem-trying-to-wrap-a-microsoft-word-paragraph-in-xml-tags-?forum=worddev#8dad5670-d90b-4ea8-abe2-bc785a2368ca
    I would suggest you focus on that thread to get more dedicated support.
    Thanks for your understanding.
    Regards.
    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.

  • How to add Multiple XML Tags for a single column for an RDF

    Hi Gurus,
    I have Requirement in the Oracle D2k Report from which we are generating the xml tags.
    My Requirement is in a table i have 2 columns say A and B.
    i am able to generate three xml tags separately using the report builder by clicking on the column name and in the xml setting giving the xml tag.
    eg: table Acount contains 2 columns A and B with respective data
    A B
    QT 1
    QTS 0
    QTR 2
    i am able to general xml tags like this
    <ACount>
    <AStatus>QT</AStatus>
    <HeadCount>1</HeadCount>
    </ACount>
    <ACount>
    <AStatus>QTS</AStatus>
    <HeadCount>0</HeadCount>
    </ACount>
    my requiremnt for the xml tags is
    <ACount>
    <AStatusQT>1</AStatusQT>
    <AStatusQTS>0</AStatusQTS>
    </ACount>
    kindly help me out how to achieve this requirment in the rdf file mulitple xml tags.
    all your input are most valuable to me, thanks in advance
    Edited by: 909577 on Apr 9, 2012 3:10 PM

    I'm sorry for being so dense, but I'm not quite following, although what I've tried makes me think if I can follow you, it will work :)
    To answer your initial questions, you are correct with both your assumptions:
    1) detailType is the parameter that specificies YTD/Weekly, this is a "report defined" parameter that I am using to determine which Row Group to display (either YTD or Weekly)
    2) SchoolDaysActiveWeek is the parameter that is being set to either true or false -- this is a field in the cube that states whether that record is for the current week or not
    So in following your instructions, well that's the problem I'm not quite following :)
    1) When you say Delete the SchoolDaysActiveWeek parameter from the report only, do you mean to mark the parameter as Hidden?  If so, I've done this.
    2) I'm not quite sure where to use the statement you provided me.  You said to put it in the dataset, but I don't know which dataset.  I assume you mean the "main" dataset (as opposed to the hidden dataset that gets generated when you mark a field
    as a parameter).  If this is the case, the only place I could see that would allow you to use such a statement is in the Filter section of the properties.  I tried this, and it did not generate any errors, but it also kept my report groups from displaying
    -- it just showed a blank report, so I think it probably wasn't bringing back any rows to populate them with.
    I also tried going into the Expression section for the SchoolDaysActiveWeek parameter in the second screenshot and placing the statement there.  When I did this and ran the report, I would get the following error:
    The 'SchoolDaysActiveWeek' parameter is missing a value
    So what am I missing!? 
    Also, thanks for taking the time to respond!!

  • How can i find and replace xml tags?

    Hi, i am using xml in my workflow and want to be able to remove certain tags if they contain particular text.
    here is an example of my xml structure…
    <entry>
        <name>DEFAULT</name>
        <tel>DEFAULT</tel>
        <address>DEFAULT</address>
    </entry>
    I am using this initial structure to set the paragraph styles to be followed when the xml data is imported.
    This leaves DEFAULT in place wherever an entry doesn't have any content for that field.
    I want to be able to import my XML then run a script that removes any tags that include DEFAULT, - I need the entire xml tag to be removed not just the text, if i do a normal find and replace it will only remove the text not the tags which is causing problems with styling. I also want to remove the end of para/return (^p) that i've placed at the end of the line. So it would be the same as opening up story editor and removing the content + tags + hard return in there, but i want to automate the process…
    So i think this is what i need to search for in each case
    "<name>DEFAULT</name>^p"
    and i want to replace it with nothing ""
    Can this be done through scripting (ideally javascript)?
    I have a little knowledge of javascript but am not sure how to search and target that kind of string in indesign...
    using indesign cs5
    many thanks

    Hi,
    Script should do it in two steps:
    1. find all occurences of i.e. ">DEFAULT<"
    2. remove whole paragraph which is a found_text's container.
    For example this way -JS - (a textFrame filled with your text should be selected) :
    var mStory = app.selection[0].parentStory;
    app.findTextPreferences =  null;
    app.findTextPreferences.findWhat = ">DEFAULT<";
    var myF = mStory.findText();
    var count = myF.length;
    while (count--)
         myF[count].paragraphs[0].remove();
    rgds

Maybe you are looking for

  • Save Image size setting in Save for Web

    I'm using Save for Web (CS3) and scaling the file to different sizes with "scale image". I'm wanting to use the same scale settings for many images but when I save the pre-set the image size settings don't get saved. I'm wanting to use it as part of

  • Status of the Sale order

    Hi Experts     In which tabe we will get the status of the sale order.But in the screen it shows VBSTT-GBSTA_BEZ.      VBSTT is astructure Regards Mano

  • Getting the XPath from a Node

    Hey Folks, have a scenario where i need to link my data, i.e one node points to another node, e.g <data> <liability id="1"> <value> 10000 </value> </liability> <asset id = "2"> <value> 20000 </value> </asset> </data> so take the case above, i have a

  • Ituneshelper was not installed correctly

    hi, when i try to open my itunes. it says ituneshelper was not installed correctly. i tried uninstalling it then reinstalling it but it still says the same thing. Help?

  • Iphone locked up while updating to i0S6 will only show itunes logo on screen w/ usb

    my iphone has locked up and will only show the itunes logo with a usb port and an arrow ?  Have rebooted both the iphone and the computer with no change.