Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hello.

    I am trying to edit some XML to include a new line (2 as it happens) however I cannot edit the XSL stylesheet.

    I have tried using
    (Carriage Return and Line Feed) and I have tried using CDATA to put in a <br />, <p></p> etc but to no avail.

    The XML looks like this:

    Code:
    <?xml version='1.0'?>
    <packet><ntminfo>Lorem ipsum, mary had a little lamb, (i want newline here)</ntminfo><chartinfo>On Chart 123</chartinfo><cautionary_note><headline>Heading</headline><bodyline>Lorem ipsum<bodyline></cautionary_note></packet>
    Any ideas?

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    Just stabbing at it in the dark ...

    Code:
    <?xml version='1.0'?>
    <packet><ntminfo>Lorem ipsum, mary had a little lamb, <xsl:text>
    </xsl:text></ntminfo><chartinfo>On Chart 123</chartinfo><cautionary_note><headline>Heading</headline><bodyline>Lorem ipsum<bodyline></cautionary_note></packet>

    On Google, this is sort of a hot topic because it sounds like there
    might be a bug with XML. I'm also not sure about which, "writing" or "reading",
    that causes newlines to be normalized. It is confusing.


  4. #3
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    mlseim, thank you for your post. I cannot access the service needed right now but I will try that tomorrow.

    The reason why I cannoy edit the xsl stylesheet is because it is provided by a third party. They are not against changing the XSL per se, but we are trying to develop a better solution and take our idea and say "this is how you should be doing it".

    I will let you know tomorrow.

    Cheers

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    What are you editing the XML with? If DOM, you probably have the ignoreWhitespace option set, which ignores excess tabs, spaces, and line breaks.

  6. #5
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    The plot thickens, smoseley.

    The XML is not scripted at all, it is purely used as a data medium for special notices that are sent to Mariners all over the world. Each notice can be applied to one or more different charts (this is going off topic).

    Because these XML files are supplied to us, we want to edit the files as little as possible. Plus, because these files are for Mariners, the cost of their broadband/communications is a big factor for them. Alll white space not needed is stripped from the files to cut down on transmission costs.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:02 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com