Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 28th, 2008, 05:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

 With RegularExpressionObject
      .Pattern = "<ClientAvailable\b[^>]*>(.*?)</ClientAvailable>"
    .IgnoreCase = True
    .Global = True
  End With
  Set expressionmatch = RegularExpressionObject.Execute(StringToSearch)


Parsing XML "by hand" using regular expressions is a really bad idea. It might work 99% of the time, but sooner or later you'll discover you aren't doing it correctly according to the XML specification. For example, you aren't handling namespaces properly and you aren't allowing for the fact that whitespace is allowed at certain places within the start and end tags. It's also likely to be much slower than using a proper XML parser.

Raising new questions on an existing thread on a forum is also a bad idea, especially if there are dozens of existing messages - you'll find that many people have lost interest in the thread and therefore aren't available to answer your new question.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I load this xml to a dataset? chepla C# 2005 1 August 11th, 2008 08:51 AM
load XML issue AbrarNazeer XML 5 March 13th, 2008 09:43 AM
Load Xml From String ffbalota J2EE 0 January 24th, 2004 06:30 PM
Load Xml From String ffbalota JSP Basics 0 January 24th, 2004 06:29 PM
Load Xml From String ffbalota Apache Tomcat 0 January 24th, 2004 06:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.