Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: XML / regex - cleaning up attributes

by halfcountplus (Hermit)
on Oct 01, 2010 at 17:27 UTC ( #862993=note: print w/replies, xml ) Need Help??

in reply to Re: XML / regex - cleaning up attributes
in thread XML / regex - cleaning up attributes

>>The XML in question comes from my code so complaints are typically ignored.

:LOL: Okay, so you are saying you produced the XML in the first place? Why don't you clean the path first then -- not only easier, but more efficient than getting some module to parse the bad xml afterward.

If that field can really contain anything you can't just swap ' for " as a delimiter, and CDATA has the same delimiter issue. That is the crux of the issue: you need a delimiter, either ' or " or CDATA. Choose one (IMO: stick with ') and replace that delimiter in the data before you create the xml.


Replies are listed 'Best First'.
Re^3: XML / regex - cleaning up attributes
by ikegami (Pope) on Oct 01, 2010 at 17:48 UTC
    You also need to replace & with &.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://862993]
[stevieb]: Torturing one of my dev RPis to turn four 5v stepper motors at the same time (via Parallel:: ForkManager for 50k degrees (a whole lot of full turns!). Let's see if it burns out or not.
[stevieb]: My GPIO expander chips should arrive tomorrow, but I think I'll throw a shift register against them and see if all six I have will turn at once. Amps are near the breaking point, but I want to know max sustainable V and I output.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2018-03-22 22:16 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.