Mmm, I was thinking I might need to write a script, but hoping for a less time-consuming solution.
Is there an XML tidier than will ignore CF? I forgot to mention initially, but this is for CF custom tags, so I wouldn't want things like <cfelse> getting picked up - although since the tags all use the same prefix, if I could just specify that they had to start with that then it might be fine. I probably want more a validator than a tidier I guess - something that reports problems and lets me fix them, rather than trying to be clever. On 11/2/07, Ben Doom <[EMAIL PROTECTED]> wrote: > > This kind of thing (parsing) is pretty hard in regex. I think it's > possible, but I can't think offhand of an easy way to do it and be sure > your XML is valid (ie, you could have three open tags and one close tag). > > What I would probably do (if I were doing it from scratch) is build > something that loops over the document, reading each tag and building a > "stack" where you add open tags and remove the top tag when you find the > matching close tag. > > In reality, what I would do is run it through an XML tidyer like the XML > codesweeper in HS+. > > --Ben Doom > > Peter Boughton wrote: > > Can anyone provide a regex that will identify any <prefix:tag...> which > isn't followed by its own </prefix:tag> > > > > Getting the initial tag is easy enough ( <prefix:([a-z_]+)[^>]*[^/]> ), > but I can't think how to check for a lack of closing tag. > > > > > > (This is just for a one-off check/fix, so if anyone knows of a > tool/editor that can do this (for a little under two thousand files), > without getting muddled up by CF tags, that would work too) > > > > > > Thanks. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1076 Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
