Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default xml parser in Excel

Hi NG

I have some meta-data stored as text in cells in a worksheet e.g.
<info<typebase</type<versiontest</version</info

I want to start an XML parser in VBA and parse the above line to my program.

Does any of you have any comments on how that is accomplished in Excel?

Regards
Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default xml parser in Excel

Replying to my own post. I am using Office XP if thats any help. Found bits
and pieces of tutorial stuff on msdn about xml but it was only for Office
2003

Basically i just want to parse a string through an XML parser in VBA. That
must be possible! XML been round for years!

Mark



"Mark" wrote in message
...
Hi NG

I have some meta-data stored as text in cells in a worksheet e.g.
<info<typebase</type<versiontest</version</info

I want to start an XML parser in VBA and parse the above line to my

program.

Does any of you have any comments on how that is accomplished in Excel?

Regards
Mark




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default xml parser in Excel

Again replying to my own mail ;-)

The deal is this. On Microsofts site you will find something called MSXML it
is microsofts XML parser. It works in javascript (via activeX) and in C++
and in VB. It also works in VBA.

Here is how you make it work in VBA

From the Tools menu in the Visual Basic Editor, select References and find
MSXML
Thats it! Pure and simple!!

Now I just need to make it work on strings! Be right back...

Mark


"Mark" wrote in message
...
Replying to my own post. I am using Office XP if thats any help. Found

bits
and pieces of tutorial stuff on msdn about xml but it was only for Office
2003

Basically i just want to parse a string through an XML parser in VBA. That
must be possible! XML been round for years!

Mark



"Mark" wrote in message
...
Hi NG

I have some meta-data stored as text in cells in a worksheet e.g.
<info<typebase</type<versiontest</version</info

I want to start an XML parser in VBA and parse the above line to my

program.

Does any of you have any comments on how that is accomplished in Excel?

Regards
Mark






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default xml parser in Excel

For the last time replying to my on post ;-)

To make XML parsing work with strings from within VBA just do this:

Dim source As MSXML2.DOMDocument40
Set source = New MSXML2.DOMDocument40

okay now "source" is initialized and we can start using it!!
Let's read a string

source.loadXML("<testHello World</test")

It works!
Hope you guyz in the NG could use this information...

Regards
Mark


"Mark" wrote in message
...
Again replying to my own mail ;-)

The deal is this. On Microsofts site you will find something called MSXML

it
is microsofts XML parser. It works in javascript (via activeX) and in C++
and in VB. It also works in VBA.

Here is how you make it work in VBA

From the Tools menu in the Visual Basic Editor, select References and find
MSXML
Thats it! Pure and simple!!

Now I just need to make it work on strings! Be right back...

Mark


"Mark" wrote in message
...
Replying to my own post. I am using Office XP if thats any help. Found

bits
and pieces of tutorial stuff on msdn about xml but it was only for

Office
2003

Basically i just want to parse a string through an XML parser in VBA.

That
must be possible! XML been round for years!

Mark



"Mark" wrote in message
...
Hi NG

I have some meta-data stored as text in cells in a worksheet e.g.
<info<typebase</type<versiontest</version</info

I want to start an XML parser in VBA and parse the above line to my

program.

Does any of you have any comments on how that is accomplished in

Excel?

Regards
Mark








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default xml parser in Excel

Found a better example

Sub Test()

Dim xmldoc As MSXML2.DOMDocument
Dim doc As MSXML2.IXMLDOMElement
Dim node As MSXML2.IXMLDOMNode

Dim xs As String

' replace { with <

xs = "{a}{b}test one{/b}{b}test two{b}{/a}"

Set xmldoc = CreateObject("Microsoft.XMLDOM")

xmldoc.loadXML xs '- it's a well formed xml string

Set doc = xmldoc.documentElement

For Each node In doc.childNodes

'code

MsgBox node.Text

Next

End Sub





"Mark" wrote in message
...
For the last time replying to my on post ;-)

To make XML parsing work with strings from within VBA just do this:

Dim source As MSXML2.DOMDocument40
Set source = New MSXML2.DOMDocument40

okay now "source" is initialized and we can start using it!!
Let's read a string

source.loadXML("<testHello World</test")

It works!
Hope you guyz in the NG could use this information...

Regards
Mark


"Mark" wrote in message
...
Again replying to my own mail ;-)

The deal is this. On Microsofts site you will find something called

MSXML
it
is microsofts XML parser. It works in javascript (via activeX) and in

C++
and in VB. It also works in VBA.

Here is how you make it work in VBA

From the Tools menu in the Visual Basic Editor, select References and

find
MSXML
Thats it! Pure and simple!!

Now I just need to make it work on strings! Be right back...

Mark


"Mark" wrote in message
...
Replying to my own post. I am using Office XP if thats any help. Found

bits
and pieces of tutorial stuff on msdn about xml but it was only for

Office
2003

Basically i just want to parse a string through an XML parser in VBA.

That
must be possible! XML been round for years!

Mark



"Mark" wrote in message
...
Hi NG

I have some meta-data stored as text in cells in a worksheet e.g.
<info<typebase</type<versiontest</version</info

I want to start an XML parser in VBA and parse the above line to my
program.

Does any of you have any comments on how that is accomplished in

Excel?

Regards
Mark










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Excel - SQL Parser with VB .NET Marcela[_2_] Excel Programming 0 July 16th 03 07:02 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"