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

Similar Messages

  • Unused XML Tags in InDesign CS2.....

    Hi all,
    Using Javascript i need to generate a report for all unused XML Tags in InDesign CS2.
    Please help it is very urgent...
    Thanks in advance...
    Regards
    Subha

    Hi,
    John Hawkinson thank you so much your suggestion.
    I am new  this type of discusion (on this page). So i think anybody could not replay my answer. So i repost my question.
    I want insert tags in my Indesign CS4 files. Is this posible when i select my powermath equaiton then run script. Script add tags automatically before/after my equation. Please ignore IDML word.
    Yes i an comfortable with XSLT presently i working with Pearson ETMV2.
    I have one more question when i past my snapshot its appear properly but when i agin see my commant then my snapshot disappear (see small blue rectangle).
    Thank you John again i am new in this industry please guide.
    snegig

  • Mapping XML tags to paragraph styles that contain nested styles

    I am importing XML into InDesign (CS5.5) and the tag mapping to styles is working fine until I get to a paragraph style that contains a nested style.
    I have a sentence that starts with a number:
    1the dog runs fast.
    In InDesing properly styled looks like this:
         1  The dog runs fast.
    (tab)1(tab)The dog runs fast.
    The number is styled with a character style (Number) and the whole sentence is styled with a paragraph style (Sentence). In order to get the tabs in between the number, I have a nested style within the paragraph style (Sentence). This triggers the tabs when it hits the character style (Number) like this:
    Number up to 2 Tab Characters
    In XML, it looks like this
    <sentencetag><numbertag>1</numbertag>The dog runs fast.</sentencetag>
    Sentencetag is mapped to Sentence paragrph style and Numbertag is mapped to Number character style, but the nested style for the tabs are not displaying. I just get this in IND.
    1the dog runs fast.
    Everything works beautifully until I hit the nested styles, which I do need to get to work somehow. Any help would be much appreciated.
    Thanks in advance!

    It sounds like your tab characters are actually disappearing from content in the XML. Jeff was responding to the fact that they need to be there, and you state that you originally had them in your document, but they are not showing up once imported through the XML.
    The tabs may be disappearing in the XML document due to the "TAB" character in your text editor not being a tab, or at least not properly-formed XML TAB equivalent, OR because you are not "importing whitespace elements" when you import your XML.
    Importing whitespace elements can wreak havoc on other things in your XML structure and styled layout within the Indesign document, so I would put the XML quivalent of TAB everywhere a tab should be in your XML, and make sure NOT to import whitespace (when importing XML using "Merge Content", select not to import whitespace items from the import options).
    I believe the XML friendly character code for a TAB character is "&#9;" or "&#09;" but have not tested this. Don't include quotes when adding the character code, just the ampersand, semicolon, and everything in-between.
    Also, sounds like your tags are mapping ok for you, so your XML should look something like:
    <sentencetag>&#9;<numbertag>1</numbertag>&#9;The dog runs fast</sentencetag>.
    It should't matter where you put the TAB character equivalent in relation to your nested tag.

  • 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

  • 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 find the selection character is xml tag or not?(CS2-js)

    I have a xml tagged indesign document, when i select a tag in paragraph i cant able to find it as xml tag, it only shows me the character contents as small box, is there any way to find the selected item is xml tag or not ?
    thanks
    subha

    I have a xml tagged indesign document, when i select a tag in paragraph i cant able to find it as xml tag, it only shows me the character contents as small box, is there any way to find the selected item is xml tag or not ?
    thanks
    subha

  • How to apply paragraph styles to xml tag?

    Hi All,
    How to apply paragraph style to xml tag?

    Hi Learner,
    Try the below js code.
    var myDoc = app.activeDocument;
    try{
        mySel=app.selection[0];
        myDoc.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySel});
        }catch(e){
            alert(e);
    var myDocument = app.activeDocument;
    app.findGrepPreferences.appliedParagraphStyle = "test";
    app.findGrepPreferences.findWhat = ".+(?=\\r)"
    var mySearch = myDocument.findGrep(false);
    for (a=0; a<mySearch.length; a++){
        myDocument.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySearch[a]});
    thx,
    csm_phil

  • 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

  • XML tagged content flows in as one paragraph

    Hi gang,
    I am working on a small XML to InDesign project. I set up the document. It has paragraph and character styles. It has XML tags. It has tags mapped to styles. I built a model example of text and tagged it carefully, applying xml tags to text and not including the hard returns.
    When I import the XML and then drag it onto the page, the entire xml content shows up and most of it is correct. Most xml tags arrive as separate paragraphs that are correctly paragraph-styled.
    Except for just three xml tags. They all arrive within one paragraph. I need them to be on separate paragraphs. It ignores my xml-tagged model of text. All but these three tags show up correctly with hard returns separating them.
    How can I get the remaining three tags (which are 6 child elements deep in the xml structure) to show up as separate paragraphs instead of in one paragraph?
    Best to you,
    Mike Witherell in Maryland

    So, if the basic idea behind [Jongware]'s XSLT is what you need, you can modify it. For example, let's say you have three elements, foo, bar, and rad. foo and bar should be on their own lines.
    <?xml version="1.0" encoding="iso-8859-1" ?> 
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 
    <xsl:template match="/ | node() | @*">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()" />
    </xsl:copy>
    </xsl:template>
    <xsl:template match="foo|bar"> 
    <xsl:copy><xsl:apply-templates /></xsl:copy><xsl:text> 
    </xsl:text> 
    </xsl:template> 
    </xsl:stylesheet>
    This applies Jongware's line break template to the foo and bar tags, while copying everything else as is. You can add more tags to the second template by separating them with the bar character.

  • Find XML Tags then apply para style

    Hi everyone,
    I need your help for find xml tags and apply para graph style in InDesign CS2. We have 200 xml files apply only 7 type of paragraph styles so any one help and any JS/Apply script or any other find and replace method. I am really appreciate of my bottom of heart.
    thank you so much.

    Hi,
    Try:
    #include "../XML Rules/glue code.jsx";
    var myDoc = app.documents.item(0);
    var myRuleSet = new Array (new applyParaStyle());
    with(myDoc){
            var elements = xmlElements;
            __processRuleSet(elements.item(0), myRuleSet);
              function applyParaStyle(){
                        this.name = "Xp";
                        this.xpath = "//restaurant_name";
                        this.apply = function(myElement, myRuleProcessor){
                                  with(myElement){
                    switch(insertionPoints[0].parentTextFrames[0].parentPage.appliedMaster.name){
                        case "X-Master":                   
                        app.select(texts);
                        app.selection[0].fillColor = myDoc.colors.item("xxxx");
                        break;
                        case "guide-Scotland":
                        app.select(texts);
                        app.selection[0].fillColor = myDoc.colors.item("scotland");
                        default:                   
                        break;
                                  return true;

  • 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...

  • 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

  • How to change XML Tag sequence in XML Publisher Reports

    Hi Experts,
    I am working on XML Publisher reports, EBS 11I and Database 9i. I have standard report 'PO Printed Purchase Order Report (XML)', it's output type is XML. I want to change the sequence of groups in XML file.
    I am getting XML tags like below at present:
    LIST_G_HEADERS \ G_HEADERS \ LIST_G_HEADER_NOTES
    I want to change the sequence of groups like below.
    LIST_G_HEADERS \ G_HEADERS \ LIST_G_LINES \
    Could somebody help me how to change the sequence of XML Groups.
    Thanks in advance.

    Paul,
    This works.  Thanks!
    I am still working through the implications of having a data connection defined.  I notice that every time I submit, it creates two records in my database, one with all the fields blank, and one with the data and attachment.
    I will have to do some more digging into the double submission, but at least it is uploading the file.
    Thanks again,
    Ed

  • Replace the XML Tags which are in binary format in 4.6C Version

    Hi Experts,
    I have an issue. I am working on 4.6 c version of sap. I have a requirement to send  ftp of an xml file. I created an internal table which has components of table type too ( For Line items ). After appending a record of sales order into the table I am using   SDIXML_DATA_TO_DOM ( To attach the to the document ) and SDIXML_DOM_TO_XML ( To convert the document contents into XML ( Binary Format ).
           CLASS cl_ixml DEFINITION LOAD.
          g_ixml = cl_ixml=>create( ).
          CHECK NOT g_ixml IS INITIAL.
          m_document = g_ixml->create_document( ).
          CHECK NOT m_document IS INITIAL.
          CALL FUNCTION 'SDIXML_DATA_TO_DOM'
            EXPORTING
              NAME               = 'xmldata'   " data in character format
              DATAOBJECT         = xmldata[]
           IMPORTING
             DATA_AS_DOM        = l_dom
           CHANGING
             DOCUMENT           = m_document
           EXCEPTIONS
             ILLEGAL_NAME       = 1
             OTHERS             = 2
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CHECK NOT l_dom IS INITIAL.
          w_rc = m_document->append_child( new_child = l_dom ).
          IF w_rc IS INITIAL.
          WRITE 'OK'.
          ELSE.
          WRITE: 'ERR ='.
          ENDIF.
          CALL FUNCTION 'SDIXML_DOM_TO_XML'
            EXPORTING
              DOCUMENT            = m_document
            PRETTY_PRINT        = ' '
            IMPORTING
              XML_AS_STRING       = w_string
              SIZE                = w_size
            TABLES
              XML_AS_TABLE        = it_xml   " Final XML data ( with xml tags ( xml tags are the field names of internal table ) ) in bin
            EXCEPTIONS
              NO_DOCUMENT         = 1
              OTHERS              = 2
          IF SY-SUBRC = 0.
          WRITE 'OK'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ELSE.
          WRITE: 'ERR =',
          sy-subrc.
          ENDIF.
    So, it_xml has the binary format of XML data.
    Now the requirement is that I need to get rid of some XML tags in the final internal table XML data. Because by default, at the start of the the table row the <item> and </item> tags are inserted. This is automatically done in the Function module
    SDIXML_DOM_TO_XML.
    I want to find out the binary string of <item> and </item> and replace them by null binary string. I know how to replace the character strings but not for binary strings in 4.6 C.
    It is little bit urget. I would appreciate the quicker answer.

    Hi,
    check this program , I think this will help you
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
    data(256) TYPE x,
    END OF xml_line.
    data : itab like catsdb occurs 100 with header line.
    data : file_location type STRING.
    data : file_name like sy-datum.
    data : file_create type STRING.
    file_name = sy-datum .
    file_location = 'C:\xml\'.
    concatenate file_location file_name into file_create.
    concatenate file_create '.XML' into file_create.
    DATA: l_xml_table TYPE TABLE OF xml_line,
    l_xml_size TYPE i,
    l_rc TYPE i.
    select * from catsdb into table itab.
    append itab .
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
    I_FIELD_SEPERATOR =
    I_LINE_HEADER =
    I_FILENAME =
    I_APPL_KEEP = ' '
    I_XML_DOC_NAME =
    IMPORTING
    PE_BIN_FILESIZE = l_xml_size
    TABLES
    i_tab_sap_data = itab
    CHANGING
    I_TAB_CONVERTED_DATA = l_xml_table
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 24
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
    bin_filesize = l_xml_size
    filename = file_create
    filetype = 'BIN'
    CHANGING
    data_tab = l_xml_table
    EXCEPTIONS
    OTHERS = 24.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    write : 'INTERNAL TABLE DATA IS SUCCESSFULLY DOWNLOADED TO LOCATION', file_create .
    Thanks.

  • [CS3][JS] Apply XML tag for selected text

    Hi
      I need to apply XML tag to selected text in a tagged content.The XML tag is already applied for paragraph.I need to apply XML Tag for selected text in a paragraph.
    I have used following code, it applies tag for entire paragraph,not a selected text in a paragraph.
    app.selection[0].associatedXMLElements[0].markupTag=myDoc.xmlTags.item("italic");
    Please suggest me.
    Regards
    kumar

    The example script, markup.jsx
    //Markup.jsx
    //An InDesign CS4 JavaScript
    //Shows how to use the markup method.
    main();
    function main(){
        mySetup();
        mySnippet();
        myTeardown();
    function mySetup(){
        var myDocument = app.documents.add();
        var myPage = app.activeWindow.activePage;
        var myRootXMLElement = myDocument.xmlElements.item(0);
        var myXMLTag = myDocument.xmlTags.add("xml_element");
        var myXMLElementA = myRootXMLElement.xmlElements.add(myXMLTag);
        myXMLElementA.contents = "This is a paragraph in an XML story.";
        var myTextFrame = myPage.textFrames.add({geometricBounds:myGetBounds(myDocument, myPage)});
        myTextFrame.contents = "This is the first paragraph in a text frame.\rThis is the second paragraph in a text frame.\rThis is the third paragraph in a text frame.\rThis is the fourth paragraph in a text frame.\r";
    function mySnippet(){
        //<fragment>
        var myDocument = app.documents.item(0);
        var myPage = myDocument.pages.item(0);
        myDocument.xmlElements.item(0).xmlElements.item(0).markup(myPage.textFrames.item(0));
        //</fragment>
    function myTeardown(){
    function myGetBounds(myDocument, myPage){
        var myPageWidth = myDocument.documentPreferences.pageWidth;
        var myPageHeight = myDocument.documentPreferences.pageHeight
        if(myPage.side == PageSideOptions.leftHand){
            var myX2 = myPage.marginPreferences.left;
            var myX1 = myPage.marginPreferences.right;
        else{
            var myX1 = myPage.marginPreferences.left;
            var myX2 = myPage.marginPreferences.right;
        var myY1 = myPage.marginPreferences.top;
        var myX2 = myPageWidth - myX2;
        var myY2 = myPageHeight - myPage.marginPreferences.bottom;
        return [myY1, myX1, myY2, myX2];
    I think you can use the markup function on the selected item (Text Object have a markup method)
    Thomas B. Nielsen
    http://www.lund-co.dk

Maybe you are looking for

  • How to reopen a closed connection?

    If I'm working on a worksheet, and I lose connection, how do I reopen it? I try running my code, and the Query Result just says "Closed Connection". The little connection dropdown list on the top-right corner of the screen gets grayed out when I lose

  • [extra:editors] nvu 1.0 with KDE mimetypes

    Introduction The Nvu WYSIWYG web editor is available on two flavors:  the standard build which do not require KDE, and another one which use KDE to provide mimetypes icons on the Site Manager. This thread supports only the KDE mimetypes version.  For

  • Port 443 used by another web site

    All was working well with my evaluation of 2012E. I was able to log on the the access anywhere website. Now the service stopped working and if I try to start the "default website" I get an error message that another website may be using port 443 and

  • N8 major concern.

    I am very tempted by the n8. The camera looks awesome and I already have an N97 which I like, but with the exception of one major flaw. Charging. Basically it's the same issue experience by many, the mini usb socket is **bleep**. Won't work with the

  • How to attach sound to any button?which will continue that sound.

    Hi, Am working on Flash cs5.Can anyone tell me how to attach sound to any button?which will play after click on button.this sound should play continue till 2-3 scenes ahead.Am working on project which has 3 button with diffrent sound.and the sound bu