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
Yitzhak KhabinskySubject: Wrapped in the middle XML elements (not well-formed XML)
Author: Yitzhak Khabinsky
Date: 09 Jul 2004 03:04 PM
Originally Posted: 08 Jul 2004 02:40 PM
I decided to start a new entry on the old issue.

Here is an old link:
http://www.stylusstudio.com/SSDN/default.asp?action=9&read=2511&fid=23#7005

I am back to the same old issue where wrapped in the
middle XML elements create a not well-formed XML.
My XML files are big by size, 10-20 MB.
How about to introduce something like macro functionality
which will do the following steps:

- Search for (using regular expression) [^>]$ string;
it will search for the end of the line not ending on ‘>’ character
- Simulate ‘End’ button click;
- Simulate ‘Delete’ button click;
- Repeat the process to the end of the XML file;

Broken XML sample:
<root>
<row>
<itemNa
me>
</itemName>
</row
>
</root>

Regards,
Yitzhak

Postnext
Alberto MassariSubject: Re: Wrapped in the middle XML elements (not well-formed XML)
Author: Alberto Massari
Date: 08 Jul 2004 06:28 PM
Hi Yitzhak,
unfortunately building a macro functionality powerful enough to perform the
kind of text manipulation you ask is not a simple task, and would require a
lot of effort on our side.
So I am suggesting you this workaround:
1) download and install, if you don't have it already, ActivePerl 5.6 (you
can download it for free from http://www.activestate.com)
2) inside Stylus Studio, go to Tools | Options | Custom Tools
3) add a new tool by clicking on the button in the top right corner, and
name the tool (e.g. "Fix broken XML")
4) click on the "Browse" button next to the "Command" edit box and search
for the perl.exe executable (e.g. "C:\Perl\bin\perl.exe")
5) save the cmd.txt file attached to this message into a folder of your choice
6) in the "Arguments" edit box enter "-pi.bak c:\cmd.txt ${FilePath}"
(replace the c:\cmd.txt with the path and name of the file saved at step 5)
(for the record, it means that it will process the active document using
the instructions found in the cmd.txt file, and making a backup copy having
the .bak extension)
7) click OK

At this point, you can load the XML file inside Stylus and select Tools |
Fix broken XML; after the script runs, you will need to press alt-tab to
switch the focus away from Stylus and then press it again to get back to
Stylus. This way Stylus will check for any modification occurred to the
open files, and prompt you if he should reload it.
Clearly you can also run the perl script from a command line to perform
batch operations.

Alberto


Unknowncmd.txt

Posttop
Neal  WaltersSubject: Re: Wrapped in the middle XML elements (not well-formed XML)
Author: Neal Walters
Date: 01 Mar 2005 11:30 AM
Add double quotes around "${FilePath}"
if you are using directories with spacenames in them (such as
"my documents").
Likewise put quotes around the PERL path program name
if that is in a directory that has spaces in it.

Neal Walters
http://Biztalk-Training.com
http://XML-Online-Training.com

 
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.