XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
John VlietSubject: Changes to XML file not persisted to disk when saved
Author: John Vliet
Date: 16 Jun 2006 11:52 AM
I have a 813KB XML file with ~11,000 lines in it. Many lines are blank so I did a regular expression search for \n\s*\n and replace with \n. This completes with a dialog reading "The document has been searched and 7118 replacements were made". Visually scanning the file shows that the blank lines have been removed. Now I save the file then close the file. When I re-open the file the blank lines are back.

Postnext
Minollo I.Subject: Changes to XML file not persisted to disk when saved
Author: Minollo I.
Date: 16 Jun 2006 12:31 PM
Depending on how newlines are encoded in your document, you may have to replace \r\n\s*\r\n into \r\n; otherwise you may risk to end up with orphan \r's that are translated into newlines the next time the document is opened.

Posttop
John VlietSubject: Changes to XML file not persisted to disk when saved
Author: John Vliet
Date: 16 Jun 2006 12:45 PM
That worked. Thanks. Is there a way to set the regular expression engine to check line by line so ^\s*$ would match multiple lines? When I tried that it would only match one line and a find next wouldn't find the next line.

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.