If I could ask a stupid follow-up to this... I have been messing with XML quite a bit lately, and am running into problems passing special characters inside an XML file. The biggest problem is that the data is largely user controlled (Meaning I have no control!)
I wrote a function that basically sanitizes all the contents of an XML tag and replaces any special characters, but I am sure there is a better way of passing this type of information around. Specifically I have had problems with & < and " Can any of you share a good way of fixing this, or perhaps point me in the right direction? Thanks Mike -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Trevyn Meyer Sent: Wednesday, May 30, 2007 1:29 PM Cc: [email protected] Subject: Re: [UPHPU] XMP and PERL issue No laughs anymore huh? The problem was with the @ symbol, and I thought it was so obvious that my comments would be funny. Props to Mac. Trevyn Randy Moller wrote: > Mac; Watch where you're throwing those pearls..... ;) > > Randy > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of > Mac Newbold > Sent: Wednesday, May 30, 2007 12:56 PM > To: Trevyn Meyer > Cc: [email protected] > Subject: Re: [UPHPU] XMP and PERL issue > > Friday at 3:53pm, Trevyn Meyer said: > > >> Nope you all are stupid. >> > > Well, it looks like that kind of shut down the conversation. Did you ever > get it working? > > I hate to say it, and I'm not a complete expert on this topic, but I would > doubt that @ and . would be valid for a tag in XML. Your second XML uses > it, and it seems to be causing a problem. They can be inside of a pair of > tags I'm sure, but using them as the name of the tag seems bad. You could > use them as an attribute value in a tag I bet, like this: > > <person id='[EMAIL PROTECTED]'> > ... > </person> > > Anyway, good luck. In the future, you'll probably get better results if > you don't reply rudely to people who are trying to answer a question you > asked. They're not getting anything out of it, so you might as well be > nice to people who are helping you for free, especially if you want help > in the future. I guess I assumed that was common sense and normal > etiquette, but perhaps I was wrong. > > If we indeed are all stupid, do you have a reference for an XML spec that > says that @ and . are allowed in tag names, so we can educate ourselves? > > Thanks, > Mac > > >> Scott Hill wrote: >> >>> On 5/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> >>>> Trevyn, I'm not sure you can use an '@' or a '.' in an xml tag, can >>>> you? I've never even tried it. That's the first thing I'd change. >>>> >>>> -- Cole >>>> >>> He's right. You can't use an email address as a tag. >>> > > -- > > Mac Newbold MNE - Mac Newbold Enterprises, LLC > [EMAIL PROTECTED] http://www.macnewbold.com/ > > _______________________________________________ > > UPHPU mailing list > [email protected] > http://uphpu.org/mailman/listinfo/uphpu > IRC: #uphpu on irc.freenode.net > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.472 / Virus Database: 269.8.3/824 - Release Date: 5/29/2007 > 1:01 PM > > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.472 / Virus Database: 269.8.3/824 - Release Date: 5/29/2007 > 1:01 PM > > > > _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
