Xml indents vs tabs in InDesign: whitespaces & linebreaks

Hi hello!
My name is Steven and I have an issue concerning working with XML for use in InDesign.
I've made a valid .xml document structured with tags, so I can use the tags for rendering the lay-out (using InDesign styles).
The mapping works well, but the hangups are whitespaces and line breaks.
Now, what's a bit confusing is the fact that when I import the XML file into my InDesign document, it renders aswell the used tabs of my XML file.
Basically InDesign seems to pick up whatever whitespace and linebreaks are found in the XML files.
But these are meaningless to XML and HTML, so why does InDesign treat and XML file as if it's a formatted document?
I found some whitespace handlings such as <?whitespace-handling use-characters?> but they don't work for me...
Perhaps it's something I'm doing wrong? I just want InDesign to keep the linebreaks I'm using in my XML file, but not to use the tabs i'm using in XML as they just are necessary to keep the overview (legibiltiy) of my structured XML file.
If someone wants so snif in my project it's possible by using the following link:
https://www.dropbox.com/s/oaqk31yr1aykf5y/xml-sip.zip
I appreciate your comments!
Othere related/simular issues: http://www.justskins.com/forums/xml-import-whitespace-and-78216.html

Six_Steven,
The past three and some hours I've been struggling with the exact same issue. I want *some* of the white space imported (at the end of tags that translate to paragraphs) but not *all* (i.e., in my source about every major XML element ends with a hard return).
This post
http://forums.adobe.com/thread/510602
gave me the crucial hint. Here is what I did: uncheck "Import white-space only elements". That way, you get everything on the same line. That's what I wanted  because I also have a simple XSLT file that basically says
<xsl:template match="title"><title><xsl:apply-templates /><xsl:text>
</xsl:text></title></xsl:template>
for each of the elements where I do want a hard return at the end. Note the <xsl:text>..</xsl:text>, which contains only a single Return. This is "the" trick; all redundant white space is removed, and this one command inserts it where needed.
(Edit) oh wait ... I needed "only one more thing" with this. And, naturally, this trick works three times but I cannot get it to work a fourth time.
(Edit #2) Solved, after another 2 hours or so of teeth-grinding and hair-pulling.
The trick seems to be:
1. Do not use InDesign's own 'ignore whitespace'. It's worthless, in the sense it's an all-or-nothing option -- and you don't want either.
2. Using XSLT, remove all whitespace inside all elements using
<xsl:template match="text()"><xsl:value-of select="normalize-space()"/></xsl:template>
3. .. and selectively maintain whitespace where you want it using
<xsl:template match="saveInside//text()"><xsl:value-of select="."/></xsl:template>
where saveInside is the name of the main XML tag in which you do want the original whitespace to remain.

Similar Messages

  • How can import XML, keeping "untagged" TABs?

    At a number of places at this forum I find this or similar comments / recommendations:
    "my advice would be to avoid formatting text by doing anything  to the XML file. InDesign is made for formatting text, so it can do it  better. I recommend you take a close look at how the tags and paragraph  returns are arranged in the (pre-import) InDesign document rather than  the XML file."
    I try to do follow this advise, by putting TABs in the "template". See image below, showing tagged placeholder text:
    As you can see, there are TABs between the tags in the template. When importing a matching `XML file, these TABs disappear, and the text looks like this:
    I have tried a lot of combinations of import settings, but none of them seems to result in keeping the tabs.
    This import setting:
    results in a fairly good looking import, but the tabs are gone...
    Others have put the tabs and white space data inside the XML, but every time they say that, there is a comment like the one referred to at the top of this post.
    But then, how CAN tabs in the template be kept when importing XML? Please explain.
    (Edit: The TABs are of cource tagged in one meaning, being inside the surrounding PRD elements in my example)
    Best regards,
    Andreas

    I might be talking to myself here. Anyway:
    Chosing to ignore white space when importing...
    means that the import is leaving the TABs intact, but that somehow also means that Carriage Returns and/or Line Feeds are not repeated as it was properly before:
    So if tabs are kept this way, then how should I manage new lines?

  • Pull-out tab in InDesign CS6

    Hi there,
    I am struggling to create a pull-out tab in InDesign CS6. I tried the method outlined by Colin Flemming in his video, but this no longer seems to apply.
    How must I go about creating a pull-out tab (horizontal) with the new DPS tools? Scrollable frame?
    Thanks,
    Tess

    Was this the video you watched?
    http://www.youtube.com/watch?v=OmMnH5h2chw
    It was really helpful to for me and yes you do your the scrollable frame

  • Paragraph Indents vs Tab Settings

    Trying to format a book length document using paragraph styles. So far, so good.
    I've made separate styles for 'chapter body text - first paragraph,' and 'chapter body text.'
    I'd like regular 'chapter body text' to be indented by, say, 0.25".
    Question is, do I use Paragraph Indents or Tab Settings to achieve this?
    Paragraph Indents seems to work, but I don't really know what Tab Settings are, and haven't been able to determine their behaviour by experiment.
    thanks,

    Hi SSS,
    Your paragraph indent is the way to go! Keep with it.
    Tabs: You might find View > Show Rulers helpful. To add a tab stop, click on the ruler. In this screenshot, there is a tab stop (blue right pointing triangle) at 1 cm in from the left indent (blue down arrow) on the ruler.
    The Tab stop will align a Tab character typed from the keyboard. You can have several tabs stops per line.
    Another way to add a tab stop:
    Inspector > Text > Tabs > Tab Stops and click on the + button. The screenshot shows there is a left tab stop at 1 cm. You can double click to edit the position, or drag the Tab Stop on the ruler.
    Page 94 of the Pages'09 User Guide: Setting Tab Stops to Align Text.
    Download the Guide from the Help Menu in Pages.
    Regards,
    Ian

  • How to indent or tab lines

    A beginners question for sure.  (InDesign CS5)
    I am attaching a screen shot so you can understand my question.  I have 2 paragraphs.  I want the lines under the first line in each paragraph to line up under the word The.
    I thought I had a tutorial on paragraphs that explained this but I can't find it.  :-/
    Or if explanaton is too much ... what would I google to find answers?
    Thanks in advance

    You can accomplish a hanging indent by these two methods:
    Open tab panel, place cursor within text, drag the two triangles to the right where text will align. Drag the top triangle back to the left where first indent only will align (this is the hanging indent). Add a tab to the location where copy after underscore aligns. Enter a tab after underscore
    Open Paragraph panel, place cursor within text, enter numeric values for each: left indent and first line (this will be a negative value)

  • XML Publisher Multi tab Report: Help needed

    Hi,
    I have a requirement like below--
    Need to develop master detail XML Report in R12. O/P will be in excel.
    Excel output having two Work sheet.
    Some columns data must be non editable in excel output ,whereas some columns will be editable.
    User must not be able to add any line manually in the report.
    Can anyone pls help me out to find a way to build this?????????
    Thanks
    Titas

    Hi Titas,
    Any luck with this? Were you able to create a multi-tab report using XML Publisher? Any help on this will be greatly appreciated.
    Thanks.

  • Parse XML file, read a tag with whitespaces value.

    Hi all,
    I've got a problem with reading a spaced value record from xml file using sys.xmltype.
    My xml file contains the following:
    <?xml version = '1.0'?>;
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME> </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    As you see last name contains four spaces!
    Now when I'm trying to read value from LASTNAME record I'm getting a NULL value, but I want it to return me those 4 spaces as they are.
    Here is a short code description of what I'm doing:
    declare
         xml sys.xmltype;
    str1 varchar2(100);
    str2 varchar2(100);
    begin
         xml := sys.xmltype.createxml(fileContentClob); -- I copy the file content into the fileContentClob variable.
         If xml.existsnode('//ROW['1']/LASTNAME') > 0 Then -- This condition evaluates as true
    str1 := xml.extract('//ROW['1']/LASTNAME/text()'); -- str1 gets NULL value :(, I want spaces as they are in the file.
    str2 := xml.extract('//ROW[' || 1 || ']/LASTNAME').getstringval; -- str2 gets <LASTNAME/> null tag :(.
         End If;     
    end;
    Seems like when it createxml from the fileContentClob it ignores the spaces and find LASTNAME as a null field.
    Do you have any suggestions on how can I fix that, so I can read whitespaces as they are in the file?
    I generate the file also using a xml toolpackage from oracle:
    declare
    strSqlStmt Varchar2(300);
    varCtxHdl dbms_xmlquery.ctxhandle;
    varClob Clob;
    begin
    strSqlStmt := 'SELECT FIRSTNAME,LASTNAME,AGE FROM USERS WHERE ROWNUM =1';
    varCtxHdl := dbms_xmlquery.newcontext(strSqlStmt);
    varClob := dbms_xmlquery.getxml(varCtxHdl);
    dbms_xmlquery.closecontext(varCtxHdl);
    End;

    Even if the STORE AS CLOB clause is used to store the data and preserve whitespace for the XML, the actual extraction of data seems to be removing whitespace...
    SQL> ed
    Wrote file afiedt.buf
      1* create table t (xml xmltype) xmltype xml store as clob
    SQL> /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  insert into t (xml)
      2  values (q'[<?xml version = '1.0'?>
      3  <ROWSET>
      4  <ROW num="1">
      5  <FIRSTNAME>Nik</FIRSTNAME>
      6  <LASTNAME>    </LASTNAME>
      7  <AGE>30</AGE>
      8  </ROW>
      9* </ROWSET>]')
    SQL> /
    1 row created.
    SQL> select * from t;
    XML
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME>    </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    SQL> set null NULL
    SQL> select x.rnum, x.firstname, x.lastname, x.age
      2  from t
      3      ,xmltable('/ROWSET/ROW'
      4                PASSING t.xml
      5                COLUMNS rnum      NUMBER       PATH '/ROW/@num'
      6                       ,firstname VARCHAR2(10) PATH '/ROW/FIRSTNAME'
      7                       ,lastname  VARCHAR2(10) PATH '/ROW/LASTNAME'
      8                       ,age       NUMBER       PATH '/ROW/AGE'
      9               ) x
    10  /
          RNUM FIRSTNAME  LASTNAME          AGE
             1 Nik        NULL               30
    SQL>

  • How to set xml tag to nothing in indesign using applescript?

    Hi guys,
    I need set xml tag to nothing(for tables)  in indesign using applescript.
    Please help me.

    Hi,
    tell application "Adobe InDesign CC 2014"
        tell active document
            if (count of story) > 0 then
                tell story 1
                    if (count of tables) > 0 then
                        tell table 1
                            set tag_name to associated XML element ----------------> i can't get xml  tag, i am receiving the  xml tag is nothing.
                            if (tag_name = nothing) then
                                display dialog ("This table has no tag")
                            else
                                set markup_tag to markup tag of tag_name
                                set n to name of markup_tag
                                display dialog ("Tag name is " & n)
                            end if
                        end tell
                    end if
                end tell
            end if
        end tell
    end tell
    I can't get xml tag for table,  i am received nothing

  • Firefox opens application/vnd.adobe.xdp+xml in new Tab/Window

    Hello,<br /><br />I´m using  Livecycle Designer 7.0, Acrobat Reader 7, 8 and 8.1. <br />We want to open XDP File (with a PDF enclosed element) in browser using a Java/Servlet.<br />It opens fine in IE 6.0 but when we open it with Firefox 2.0.0.9<br />it´s opened in a new tab!. Any idea to avoid this behavior?. Sth worng with de pluggin?<br /><br />Thanks<br /><br />/*Servlet code*/<br />String content = "<?xml version=\"1.0\" encoding='UTF-8'?>\n" +<br />"<?xfa generator=\"AdobeDesigner_V7.0\" APIVersion=\"2.2.4333.0\"?>\n" +<br />"<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">\n" +<br />"<xfa:datasets xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\">\n" +<br />"<xfa:data xfa:dataNode=\"dataGroup\">\n";    +<br />"<form1><TextField1>aaaaaaaa</TextField1></xfa:data>" +<br /><pdf href=\"pathname/filename.pdf\" xmlns=\"http://ns.adobe.com/xdp/pdf/\" />\n" +                <br />"<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\">\n" +<br />"</xfdf>\n" +<br />"</xdp:xdp>\n";<br />                <br />ServletOutputStream out = response.getOutputStream();<br />response.setContentType("application/vnd.adobe.xdp+xml");<br />response.setHeader("Content-Disposition","inline;filename=xdpfile.pdf");                              <br />bytes[] contentBytes = content.getBytes("UTF-8");<br />response.setContentLength(contentBytes .length);<br />out.write(contentBytes );<br />out.flush();<br />out.close();<br />/*Servlet code*/

    I have a different issue.  When I open the xdp in a browser it only displays the xml code on the screen.  Do I need something else installed on my intranet server?  I can open the referenced PDF directly in the browser and if I map to the drive the xdp is located I can open it directly.  The browser just wont work for me IE 6.  <br /><br />Any help would be greatly appreciated.<br />Xdp file:<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><?xfa generator="XFA2_4" APIVersion="2.4.6053.0"?><br /><xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/"><br /><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"<br />><xfa:data<br />><topmostSubform<br />><memberNum>1234</memberNum<br />><memberName>Brian</memberName<br />><currDate>3/25/2009</currDate><br /></topmostSubform></xfa:data><br /></xfa:datasets><pdf href="Sign.pdf" <br />xmlns="http://ns.adobe.com/xdp/pdf/"/></xdp:xdp>

  • Missing Tabs Panel/Indesign CS6

    Hello.  I just upgraded from CS4 to CS6 and resumed working on a book, only to find that there is no Tabs panel to be found anywhere (see attached jpg image). It's usually right under Paragraph in the Type Menu. It's also not in the Windows/Type Menu.  I've been searching high and low around the program and on the internet and cannot find any clues.  The Tabs instrutional videos on YouTube clearly show CS6 with a Tabs panel available in its traditional spot. I know this is bizarre and it's about to make me freak out because it seems like it should be pretty basic and obvious.  Maybe it is and I'm missing a vital piece of info?  If you have any ideas i sure would like to hear them...

    Before the suggestions get made to re-install, a time consuming p.i.t.a. task for sure, do any users of InDesign 6 HAVE tabs in the drop down window?
    Like ej5000 I do not have tabs in my drop down menus either.  Steve I've trashed and restored my prefs so many times my head spins. Some afternoons it is literally all I get done. LITERALLY.
    ej I think you were ont to something here
    Hmmm, nothing else is working.  This is so rediculous and it's taking up all my work day.  I feel like the only solution is to semi-retire CS6, go back to CS4 and only use CS6 for importing .docx documents and exporting ePubs after I've preped them in CS4.
    Peter's suggestion is the only way I am able to view my tabs pane.
    ...press Cmd + Shift + T?
    MUCH easier and more time efficient than re-installing or needlessly/ceaselessly/endlessly deleting prefs. Since Adobe is constanly monitoring my activity and issuing updates this should get fixed on Adobe's end IMHO.

  • Indent here with left indent changes tab position

    I have a sheet set up with a left indent and then a bunch of tabs.
    e.g.: Course #, Course description, then a set of eight tabs with dates
    The course descriptions are twice as long this year and so I was using indent-to-here (because there are rules below, and shift-return pushes the rule below under the second line only). But the tabs don't line up. They are "looking" at the left indent and making an adjustment - if I increase the left indent then the tabs associated with the indent-to-here line move left (the bigger the left indent the further left they are from the tab position)
    Why?
    Why would anyone want that to be the default behavior?
    I can fix it with a second para style, but it breaks the association between the two lines of the description and now requires manual updating in the future, instead of a simple indent-to-here substitution.
    I'm just wondering why this happens, seems completely counter intuitive - tabs should always align!

    Will: As you can see by the screenshot it's easily "solved" with a second style, my reason for writing is why is this happening? - is this a bug that needs to be reported to Adobe? I don't understand why an Indent Here (given a left Indent), would change the primary attributes of tabs (i.e. lining-up!)
    Peter: Prefs trashed; happens on any/all docs; CS6 (8.0.2). [You are setting a left indent, and then using the Indent Here (Cmd\)??]
    Anyone else able to recreate?
    Appreciate the replies.
    Em

  • Simple XML converted to Tabbed Panel

    I am trying to get a dynamic dataset in the proper format for
    a tabbed panel. The xml data is returned in this format.
    <nodes>
    <node>
    <type>First</type>
    <link>http:www.net1.com</link>
    </node>
    <node>
    <type>First</type>
    <link>http:www.net2.com</link>
    </node>
    <node>
    <type>Second</type>
    <link>http:www.net3.com</link>
    </node>
    <node>
    <type>Second</type>
    <link>http:www.net4.com</link>
    </node>
    </nodes>
    I want the TabbedPanelsTabGroup or one tab for First and one
    tab for Second. I want the link nodes displayed in the
    TabbedPanelsContentGroup for each respective tab. I think filtering
    is the solution, but am not sure whether to filter the xpath of the
    dataset or filter within the spry region itself.
    Can someone point me in the right direction and provide some
    sample code. I have tried both but can't get it to work properly.
    Thank you in advance.

    See if this article by David Powers is any help towards getting what you're after:
    http://foundationphp.com/tutorials/spry_url_utils.php
    Nadia
    Adobe® Community Expert : Dreamweaver
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    Book: Ultimate CSS Reference
    http://www.sitepoint.com/launch/005dfd4/3/133
    http://twitter.com/nadiap

  • XML RPC service call from InDesign

    We've got a great internal XMLRPC service, which is normally called from a Widget in OSx. Now we want to extend our InDesign script with the functionalities of the widget. Simple: Call the XMLRPC service and place the result as text in the ID document.
    Now I ran in my first problem: How to setup a session.
    Normally I would start communicating with the server using:
        http = new XMLHttpRequest();
    or:
        http = new ActiveXObject("Microsoft.XMLHTTP");

    There are a couple of http functions out there written by various scripters that would be able to do the trick in JS. The one I wrote was for a specific task and is likely not up to the challenge, I know there's better ones out there.
    That said, the route I would take is with Flash/Flex and PatchPanel for CS3. With that approach you get an industrial strength development environment (but it's not a free environment), strong typing when you want it (avoids all those typo and "stupid" errors), a lot more bang for the buck in UI development, cross platform, and pretty good performance. Of course, Flash/Flex has all the XML, http, and web service stuff that you could ever want built in.
    I have some example projects on www.creativescripting.net that show doing some out of the box stuff with PatchPanel (PatchPanel code responding to InDesign menu events, and working with APID). If you're placing XML in InDesign, I also have a port to of the XML Glue code for InDesign's XML Rules.
    Regards
    Bob

  • Disabling font tab in InDesign CS5 Control panel

    Hi,
    Is there any option to disable the Font change option in the InDesign CS5 Control panel. That is the user should not change the font using Control panel.
    Thanks,
    Gopal

    What I need here is, whenever the user change the font using Control panel, an alert should be made to the user and the font should not be changed.
    I am confused why the method the user chooses matters.
    Why is it a problem if they use the Control panel but not the Character panel?
    I don't think you can achieve this with scripting.
    With substantial effort, you maybe able to detect when they change a font and pop up an alert, but it is pretty difficult.
    It would be more doable but still hard in the C++ SDK.

  • TSQL XML query Results tab: elements crammed together as single line

    Are the elements in a TSQL "FOR XML..." query rendered by default as a single line (wrapped-around)?(i have a screen shot but i am not allowed to post it here until my acct is 'verified').
    When i run
    SELECT    
       c.CustomerID AS '@CustomerID',
       (SELECT
           oh.SalesOrderID, oh.Status
        FROM
           Sales.SalesOrderHeader oh
        WHERE
           c.CustomerID = oh.CustomerID
        FOR XML PATH('Order'), TYPE) AS Orders
    FROM
       Sales.Customer c
    WHERE
       EXISTS (SELECT * FROM Sales.SalesOrderHeader soh WHERE c.CustomerID = soh.CustomerID)
    FOR XML PATH ('Customer'), ROOT ('Customers')
    this is what i get:
    <Customers><Customer CustomerID="11000"><Orders><Order><SalesOrderID>43793</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>51522</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>57418</SalesOrderID><Status>5</Status></Order></Order
    tus>5</Status></Order></Orders></Customer><Customer CustomerID="11008"><Orders><Order><SalesOrderID>43826</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>51282</SalesOrderID><Status>5</Status></Order><Order><SalesOrderID>53765</SalesOrderID><S
    rderID>
    Why aren't the results with XML elements nicely ordered, one element per line?
        <Customer CustomerID="11000">
            <Orders>
                <Order>
                    <SalesOrderID>43793</SalesOrderID>.....

    Where are you viewing the result? In SQL Management studio the result will be shown as link which when you click will show XML elements ordered nicely
    I've shown some examples here
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Optical Out Quest

    Hi, I'll start by saying, yes I have read the FAQ's above, but they don't seem relevant to my problem. I've recently purchased an Audigy 2 Platinum EX. I wanted to connect my PC to my Dolby Digital amp via optical connection. The Audigy dri've does i

  • Automatic tax code determination for service POs

    Hi Can anyone tell  about the possibilities of automatic tax code determination for the service purchase orders. Thanks in advance Durai

  • Location - FTP Type

    Hi everyone, I created FTP type Location and set correct parameters for Host, User, Password and path. During the file import process, when I try to expand path to select objects I alway get the same error: API2836: Directory ... does not exist. I ha

  • New mac + new hp printer won't sync up w/usb...yet old printer connects

    about 2 months ago i got a new imac and a new hp printer and when i hooked it up with my usb from my old hp printer it wouldn't connect (the mac wasn't reading that anything was connected) so i called hp and they tried to do what they could, but came

  • D10 Config Questions

    Hi.  I'm configuring a D10 for use as a Photoshop/Premiere editing station, and I'd like to know whether certain components can be "user" installed later.  For example, I'm reasonably sure that if I order the machine with 4 gigs of RAM (2x2), I can l