473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

reading inner html with xpath


Is there a way to treat html tags like simple text?
I explain myself, if I have a bunch of xml like

<content type="application/xhtml+xml"
xml:base="http://loluyede.blogspot.com" xml:lang="en-US"
xml:space="preserve">
<div xmlns="http://www.w3.org/1999/xhtml">I have 3 accounts to give away,
let me know if you want them</div>
</content>

the XPathNavigator.Value obiously returns "I have 3 accounts blah blah", is
there a way to have all the inner stuff as text if the navigator is
positioned on the <content> tag? Like

"<div xmlns="http://www.w3.org/1999/xhtml">I have 3 accounts to give away,
let me know if you want them</div>"

It's strange (and XPath doesn't provide such feature AFAIK) but it could be
useful

--
Lawrence
" It's probably for the best. What use does Microsoft have for an employee
who knows the W3C standards?"
-- an anonymous about tantek departure from microsoft
Nov 12 '05 #1
8 5079
"Lawrence Oluyede" <ra***@dot.com> wrote in message news:rr*****************************@40tude.net...
Is there a way to treat html tags like simple text?
Put them in CDATA sections?

: : the XPathNavigator.Value obiously returns "I have 3 accounts blah blah", is
there a way to have all the inner stuff as text if the navigator is
positioned on the <content> tag? Like

"<div xmlns="http://www.w3.org/1999/xhtml">I have 3 accounts to give away,
let me know if you want them</div>"
Like the InnerXml property?
It's strange (and XPath doesn't provide such feature AFAIK) but it could be
useful


It's difficult (sometimes nearly impossible) to match and manipulate arbitrary mixed
content with XPath, although I think you're referring to the XPathNavigator class.

Of course, there's nothing to prevent you from walking the navigator and serializing
it directly (a healthy aversion to angle brackets aside). Here's a class I created that
encapsulates walking a navigator:

- - - XPathWalker.cs
using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;

class NavigateEventArgs : EventArgs
{
public string NamespaceURI;
public string LocalName;
public string Prefix;
public string Value;

public NavigateEventArgs( string prefix, string localName, string nsUri, string valueStr)
{
this.Prefix = prefix;
this.LocalName = localName;
this.NamespaceURI = nsUri;
this.Value = valueStr;
}
}

class CompleteEventArgs : EventArgs
{
}

delegate bool MoveFirstDelegate( );
delegate bool MoveNextDelegate( );
delegate void NavigateEventHandler( object sender, NavigateEventArgs args);
delegate void CompleteEventHandler( object sender, CompleteEventArgs args);

internal class AxisWalker
{
private enum Status
{
Initial = 0, NoContent = 1, Active = 2
}
private MoveFirstDelegate moveFirst;
private MoveNextDelegate moveNext;
private AxisWalker.Status walkState;
protected XPathNavigator navigator;
public bool IsEmpty;

public event NavigateEventHandler Navigate;
public event CompleteEventHandler Complete;

public AxisWalker( MoveFirstDelegate firstFunc, MoveNextDelegate nextFunc)
{
this.navigator = firstFunc.Target as XPathNavigator;
this.moveFirst = firstFunc;
this.moveNext = nextFunc;
this.walkState = Status.Initial;
}

protected virtual void OnNavigate( NavigateEventArgs args)
{
if ( null != this.Navigate )
this.Navigate( this, args);
}

protected virtual void OnComplete( CompleteEventArgs args)
{
if ( null != this.Complete )
this.Complete( this, args);
}

public bool Step( )
{
if ( this.walkState == Status.Initial )
{
if ( this.moveFirst( ) )
{
this.walkState = Status.Active;
this.OnNavigate(
new NavigateEventArgs(
this.navigator.Prefix,
this.navigator.LocalName,
this.navigator.NamespaceURI,
this.navigator.ToString( )
)
);
}
else
{
this.IsEmpty = true;
this.walkState = Status.NoContent;
this.OnComplete( new CompleteEventArgs( ));
}
}
else
{
if ( this.moveNext() )
{
this.OnNavigate(
new NavigateEventArgs(
this.navigator.Prefix,
this.navigator.LocalName,
this.navigator.NamespaceURI,
this.navigator.ToString( )
)
);
}
else
{
this.walkState = Status.NoContent;
this.OnComplete( new CompleteEventArgs( ));
}
}
return ( this.walkState != Status.NoContent );
}

public void Walk( )
{
while ( this.Step( ) )
{
;
}
}

public void Reset()
{
this.walkState = Status.Initial;
this.IsEmpty = false;
}
}

internal class NamespaceAxisWalker : AxisWalker
{
public NamespaceAxisWalker( MoveFirstDelegate firstFunc, MoveNextDelegate nextFunc) : base( firstFunc, nextFunc) { ; }

protected override void OnNavigate( NavigateEventArgs args)
{
// There will be xml xmlns namespace decls on each element, although
// for most purposes, they are unnecessary in the serialization, so I
// discard them with this if-statement.
//
if ( "xml" != this.navigator.Name )
{
// Rearrange the arguments b/c Namespace axis has 'prefix' in .Name property,
// and .NamespaceURI in it's text value representation.
//
base.OnNavigate(
new NavigateEventArgs(
this.navigator.Name,
String.Empty,
args.Value,
String.Empty
)
);
}
}
}

public class XPathWalker
{
private AxisWalker elementWalker;
private AxisWalker attributeWalker;
private NamespaceAxisWalker nsWalker;
private XPathNavigator navigator;
private TextWriter sink;

public XPathWalker( XPathNavigator nav, TextWriter writer)
{
navigator = nav;
sink = writer;
elementWalker = new AxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstChild),
new MoveNextDelegate( navigator.MoveToNext)
);
attributeWalker = new AxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstAttribute),
new MoveNextDelegate( navigator.MoveToNextAttribute)
);
nsWalker = new NamespaceAxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstNamespace),
new MoveNextDelegate( navigator.MoveToNextNamespace)
);

elementWalker.Navigate += new NavigateEventHandler( this.NavigateElement);
elementWalker.Complete += new CompleteEventHandler( this.CompleteElement);
nsWalker.Navigate += new NavigateEventHandler( this.NavigateNamespace);
nsWalker.Complete += new CompleteEventHandler( this.CompleteNamespace);
attributeWalker.Navigate += new NavigateEventHandler( this.NavigateAttribute);
attributeWalker.Complete += new CompleteEventHandler( this.CompleteAttribute);
}

public void Walk( )
{
navigator.MoveToParent( );
elementWalker.Walk( );
}

private void NavigateElement( object sender, NavigateEventArgs args)
{
if ( navigator.NodeType == XPathNodeType.Element )
{
string tag = (args.Prefix.Length > 0) ?
String.Format( "{0}:{1}", args.Prefix, args.LocalName) :
args.LocalName;

sink.Write( String.Format( "<{0}", tag));

nsWalker.Reset( );
nsWalker.Walk( );

attributeWalker.Reset( );
attributeWalker.Walk( );

sink.Write( '>');

AxisWalker childWalker = new AxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstChild),
new MoveNextDelegate( navigator.MoveToNext)
);
childWalker.Navigate += new NavigateEventHandler( this.NavigateElement);
childWalker.Complete += new CompleteEventHandler( this.CompleteElement);

childWalker.Walk( );

sink.Write( "</{0}>", tag);
}
else if ( navigator.NodeType == XPathNodeType.Text )
{
sink.Write( args.Value);
}
}

private void NavigateNamespace( object sender, NavigateEventArgs args)
{
string ns = (args.Prefix.Length > 0) ?
String.Format( " xmlns:{0}='{1}'", args.Prefix, args.NamespaceURI) :
String.Format( " xmlns='{0}'", args.NamespaceURI);

sink.Write( ns);
}

private void NavigateAttribute( object sender, NavigateEventArgs args)
{
string attr = (args.Prefix.Length > 0) ?
String.Format( " {0}:{1}='{2}'", args.Prefix, args.LocalName, args.Value) :
String.Format( " {0}='{1}'", args.LocalName, args.Value);

sink.Write( attr);
}

private void CompleteElement( object sender, CompleteEventArgs args)
{
if ( !(sender as AxisWalker).IsEmpty )
navigator.MoveToParent( );
}

private void CompleteNamespace( object sender, CompleteEventArgs args)
{
if ( !(sender as AxisWalker).IsEmpty )
navigator.MoveToParent( );
}

private void CompleteAttribute( object sender, CompleteEventArgs args)
{
if ( !(sender as AxisWalker).IsEmpty )
navigator.MoveToParent( );
}
}
- - -

It's easy to walk any XPathNavigator instance with this class (positioned on any top-level context node).
The following two lines of code will emit an XmlDocument to the Console output:

XPathWalker goForA = new XPathWalker( doc.CreateNavigator( ), Console.Out);
goForA.Walk( );

That said, there's yet another method to generate serialized output from an XPathNavigator. Hand it to
an XslTransform that performs an identity transformation. As you're undoubtedly aware, XslTransform
can feed the proceeds of the transformation into any TextWriter, which is easily redirected into any old
StringWriter.

Here are three lines of code that can achieve comparable results to the XPathWalker above:

XslTransform xf = new XslTransform( );
xf.Load( "Identity.xsl");
xf.Transform( doc.CreateNavigator( ), null, Console.Out);

Now, you do need a copy of the ubiquitous Identity stylesheet to run that C# code, so here it is:

- - - Identity.xsl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="no"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
- - -

So, there's two ways to get serialize into text the inner content of the XPathNavigator. Good luck.
Derek Harmon
Nov 12 '05 #2
"Lawrence Oluyede" <ra***@dot.com> wrote in message news:rr*****************************@40tude.net...
Is there a way to treat html tags like simple text?
Put them in CDATA sections?

: : the XPathNavigator.Value obiously returns "I have 3 accounts blah blah", is
there a way to have all the inner stuff as text if the navigator is
positioned on the <content> tag? Like

"<div xmlns="http://www.w3.org/1999/xhtml">I have 3 accounts to give away,
let me know if you want them</div>"
Like the InnerXml property?
It's strange (and XPath doesn't provide such feature AFAIK) but it could be
useful


It's difficult (sometimes nearly impossible) to match and manipulate arbitrary mixed
content with XPath, although I think you're referring to the XPathNavigator class.

Of course, there's nothing to prevent you from walking the navigator and serializing
it directly (a healthy aversion to angle brackets aside). Here's a class I created that
encapsulates walking a navigator:

- - - XPathWalker.cs
using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;

class NavigateEventArgs : EventArgs
{
public string NamespaceURI;
public string LocalName;
public string Prefix;
public string Value;

public NavigateEventArgs( string prefix, string localName, string nsUri, string valueStr)
{
this.Prefix = prefix;
this.LocalName = localName;
this.NamespaceURI = nsUri;
this.Value = valueStr;
}
}

class CompleteEventArgs : EventArgs
{
}

delegate bool MoveFirstDelegate( );
delegate bool MoveNextDelegate( );
delegate void NavigateEventHandler( object sender, NavigateEventArgs args);
delegate void CompleteEventHandler( object sender, CompleteEventArgs args);

internal class AxisWalker
{
private enum Status
{
Initial = 0, NoContent = 1, Active = 2
}
private MoveFirstDelegate moveFirst;
private MoveNextDelegate moveNext;
private AxisWalker.Status walkState;
protected XPathNavigator navigator;
public bool IsEmpty;

public event NavigateEventHandler Navigate;
public event CompleteEventHandler Complete;

public AxisWalker( MoveFirstDelegate firstFunc, MoveNextDelegate nextFunc)
{
this.navigator = firstFunc.Target as XPathNavigator;
this.moveFirst = firstFunc;
this.moveNext = nextFunc;
this.walkState = Status.Initial;
}

protected virtual void OnNavigate( NavigateEventArgs args)
{
if ( null != this.Navigate )
this.Navigate( this, args);
}

protected virtual void OnComplete( CompleteEventArgs args)
{
if ( null != this.Complete )
this.Complete( this, args);
}

public bool Step( )
{
if ( this.walkState == Status.Initial )
{
if ( this.moveFirst( ) )
{
this.walkState = Status.Active;
this.OnNavigate(
new NavigateEventArgs(
this.navigator.Prefix,
this.navigator.LocalName,
this.navigator.NamespaceURI,
this.navigator.ToString( )
)
);
}
else
{
this.IsEmpty = true;
this.walkState = Status.NoContent;
this.OnComplete( new CompleteEventArgs( ));
}
}
else
{
if ( this.moveNext() )
{
this.OnNavigate(
new NavigateEventArgs(
this.navigator.Prefix,
this.navigator.LocalName,
this.navigator.NamespaceURI,
this.navigator.ToString( )
)
);
}
else
{
this.walkState = Status.NoContent;
this.OnComplete( new CompleteEventArgs( ));
}
}
return ( this.walkState != Status.NoContent );
}

public void Walk( )
{
while ( this.Step( ) )
{
;
}
}

public void Reset()
{
this.walkState = Status.Initial;
this.IsEmpty = false;
}
}

internal class NamespaceAxisWalker : AxisWalker
{
public NamespaceAxisWalker( MoveFirstDelegate firstFunc, MoveNextDelegate nextFunc) : base( firstFunc, nextFunc) { ; }

protected override void OnNavigate( NavigateEventArgs args)
{
// There will be xml xmlns namespace decls on each element, although
// for most purposes, they are unnecessary in the serialization, so I
// discard them with this if-statement.
//
if ( "xml" != this.navigator.Name )
{
// Rearrange the arguments b/c Namespace axis has 'prefix' in .Name property,
// and .NamespaceURI in it's text value representation.
//
base.OnNavigate(
new NavigateEventArgs(
this.navigator.Name,
String.Empty,
args.Value,
String.Empty
)
);
}
}
}

public class XPathWalker
{
private AxisWalker elementWalker;
private AxisWalker attributeWalker;
private NamespaceAxisWalker nsWalker;
private XPathNavigator navigator;
private TextWriter sink;

public XPathWalker( XPathNavigator nav, TextWriter writer)
{
navigator = nav;
sink = writer;
elementWalker = new AxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstChild),
new MoveNextDelegate( navigator.MoveToNext)
);
attributeWalker = new AxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstAttribute),
new MoveNextDelegate( navigator.MoveToNextAttribute)
);
nsWalker = new NamespaceAxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstNamespace),
new MoveNextDelegate( navigator.MoveToNextNamespace)
);

elementWalker.Navigate += new NavigateEventHandler( this.NavigateElement);
elementWalker.Complete += new CompleteEventHandler( this.CompleteElement);
nsWalker.Navigate += new NavigateEventHandler( this.NavigateNamespace);
nsWalker.Complete += new CompleteEventHandler( this.CompleteNamespace);
attributeWalker.Navigate += new NavigateEventHandler( this.NavigateAttribute);
attributeWalker.Complete += new CompleteEventHandler( this.CompleteAttribute);
}

public void Walk( )
{
navigator.MoveToParent( );
elementWalker.Walk( );
}

private void NavigateElement( object sender, NavigateEventArgs args)
{
if ( navigator.NodeType == XPathNodeType.Element )
{
string tag = (args.Prefix.Length > 0) ?
String.Format( "{0}:{1}", args.Prefix, args.LocalName) :
args.LocalName;

sink.Write( String.Format( "<{0}", tag));

nsWalker.Reset( );
nsWalker.Walk( );

attributeWalker.Reset( );
attributeWalker.Walk( );

sink.Write( '>');

AxisWalker childWalker = new AxisWalker(
new MoveFirstDelegate( navigator.MoveToFirstChild),
new MoveNextDelegate( navigator.MoveToNext)
);
childWalker.Navigate += new NavigateEventHandler( this.NavigateElement);
childWalker.Complete += new CompleteEventHandler( this.CompleteElement);

childWalker.Walk( );

sink.Write( "</{0}>", tag);
}
else if ( navigator.NodeType == XPathNodeType.Text )
{
sink.Write( args.Value);
}
}

private void NavigateNamespace( object sender, NavigateEventArgs args)
{
string ns = (args.Prefix.Length > 0) ?
String.Format( " xmlns:{0}='{1}'", args.Prefix, args.NamespaceURI) :
String.Format( " xmlns='{0}'", args.NamespaceURI);

sink.Write( ns);
}

private void NavigateAttribute( object sender, NavigateEventArgs args)
{
string attr = (args.Prefix.Length > 0) ?
String.Format( " {0}:{1}='{2}'", args.Prefix, args.LocalName, args.Value) :
String.Format( " {0}='{1}'", args.LocalName, args.Value);

sink.Write( attr);
}

private void CompleteElement( object sender, CompleteEventArgs args)
{
if ( !(sender as AxisWalker).IsEmpty )
navigator.MoveToParent( );
}

private void CompleteNamespace( object sender, CompleteEventArgs args)
{
if ( !(sender as AxisWalker).IsEmpty )
navigator.MoveToParent( );
}

private void CompleteAttribute( object sender, CompleteEventArgs args)
{
if ( !(sender as AxisWalker).IsEmpty )
navigator.MoveToParent( );
}
}
- - -

It's easy to walk any XPathNavigator instance with this class (positioned on any top-level context node).
The following two lines of code will emit an XmlDocument to the Console output:

XPathWalker goForA = new XPathWalker( doc.CreateNavigator( ), Console.Out);
goForA.Walk( );

That said, there's yet another method to generate serialized output from an XPathNavigator. Hand it to
an XslTransform that performs an identity transformation. As you're undoubtedly aware, XslTransform
can feed the proceeds of the transformation into any TextWriter, which is easily redirected into any old
StringWriter.

Here are three lines of code that can achieve comparable results to the XPathWalker above:

XslTransform xf = new XslTransform( );
xf.Load( "Identity.xsl");
xf.Transform( doc.CreateNavigator( ), null, Console.Out);

Now, you do need a copy of the ubiquitous Identity stylesheet to run that C# code, so here it is:

- - - Identity.xsl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="no"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
- - -

So, there's two ways to get serialize into text the inner content of the XPathNavigator. Good luck.
Derek Harmon
Nov 12 '05 #3
In data Sun, 27 Jun 2004 18:11:03 -0400, Derek Harmon ha scritto:
Put them in CDATA sections?
Yeah, I could in the generating step, but I have to parse :)
Like the InnerXml property?
Yeah!
Of course, there's nothing to prevent you from walking the navigator and serializing
it directly (a healthy aversion to angle brackets aside). Here's a class I created that
encapsulates walking a navigator:

[..cut XpathWalker.cs..]
very cool class, thanks!
So, there's two ways to get serialize into text the inner content of the XPathNavigator. Good luck.


I'll take into consideration both of them, thanks a lot :)

--
Lawrence
" It's probably for the best. What use does Microsoft have for an employee
who knows the W3C standards?"
-- an anonymous about tantek departure from microsoft
Nov 12 '05 #4
In data Sun, 27 Jun 2004 18:11:03 -0400, Derek Harmon ha scritto:
Put them in CDATA sections?
Yeah, I could in the generating step, but I have to parse :)
Like the InnerXml property?
Yeah!
Of course, there's nothing to prevent you from walking the navigator and serializing
it directly (a healthy aversion to angle brackets aside). Here's a class I created that
encapsulates walking a navigator:

[..cut XpathWalker.cs..]
very cool class, thanks!
So, there's two ways to get serialize into text the inner content of the XPathNavigator. Good luck.


I'll take into consideration both of them, thanks a lot :)

--
Lawrence
" It's probably for the best. What use does Microsoft have for an employee
who knows the W3C standards?"
-- an anonymous about tantek departure from microsoft
Nov 12 '05 #5
Lawrence Oluyede wrote:
the XPathNavigator.Value obiously returns "I have 3 accounts blah blah", is
there a way to have all the inner stuff as text if the navigator is
positioned on the <content> tag? Like

"<div xmlns="http://www.w3.org/1999/xhtml">I have 3 accounts to give away,
let me know if you want them</div>"

It's strange (and XPath doesn't provide such feature AFAIK) but it could be
useful


That's unfortunate omission in .NET 1.0/1.1. It's fixed in .NET 1.2

Meanwhile you can use something as simple as SerializableXPathNavigator
(http://www.tkachenko.com/blog/archives/000155.html) or
XPathNavigatorReader
(http://weblogs.asp.net/cazzu/archive...9/115966.aspx). Both of
them belong to Mvp.Xml project (http://sf.net/projects/mvp-xml).

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #6
Lawrence Oluyede wrote:
the XPathNavigator.Value obiously returns "I have 3 accounts blah blah", is
there a way to have all the inner stuff as text if the navigator is
positioned on the <content> tag? Like

"<div xmlns="http://www.w3.org/1999/xhtml">I have 3 accounts to give away,
let me know if you want them</div>"

It's strange (and XPath doesn't provide such feature AFAIK) but it could be
useful


That's unfortunate omission in .NET 1.0/1.1. It's fixed in .NET 1.2

Meanwhile you can use something as simple as SerializableXPathNavigator
(http://www.tkachenko.com/blog/archives/000155.html) or
XPathNavigatorReader
(http://weblogs.asp.net/cazzu/archive...9/115966.aspx). Both of
them belong to Mvp.Xml project (http://sf.net/projects/mvp-xml).

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #7
In data Mon, 28 Jun 2004 12:37:18 +0200, Oleg Tkachenko [MVP] ha scritto:
That's unfortunate omission in .NET 1.0/1.1. It's fixed in .NET 1.2
Great!
Meanwhile you can use something as simple as SerializableXPathNavigator
(http://www.tkachenko.com/blog/archives/000155.html) or
XPathNavigatorReader
(http://weblogs.asp.net/cazzu/archive...9/115966.aspx). Both of
them belong to Mvp.Xml project (http://sf.net/projects/mvp-xml).


God bless MVPs ;)

Thanks Oleg!

--
Lawrence
" It's probably for the best. What use does Microsoft have for an employee
who knows the W3C standards?"
-- an anonymous about tantek departure from microsoft
Nov 12 '05 #8
In data Mon, 28 Jun 2004 12:37:18 +0200, Oleg Tkachenko [MVP] ha scritto:
That's unfortunate omission in .NET 1.0/1.1. It's fixed in .NET 1.2
Great!
Meanwhile you can use something as simple as SerializableXPathNavigator
(http://www.tkachenko.com/blog/archives/000155.html) or
XPathNavigatorReader
(http://weblogs.asp.net/cazzu/archive...9/115966.aspx). Both of
them belong to Mvp.Xml project (http://sf.net/projects/mvp-xml).


God bless MVPs ;)

Thanks Oleg!

--
Lawrence
" It's probably for the best. What use does Microsoft have for an employee
who knows the W3C standards?"
-- an anonymous about tantek departure from microsoft
Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MarcoT77 | last post by:
Hi Teacher. I'm trying to get with Xpath the Product nodes in the following XML: <?xml version="1.0" encoding="utf-8"?> <PLMXML xmlns="http://www.plmxml.org/Schemas/PLMXMLSchema"...
3
by: Thierry Lam | last post by:
Let's say I have the following xml tag: <para role="success">1</para> I can't figure out what kind of python xml.dom codes I should invoke to read the data 1? Any help please? Thanks...
0
by: Lawrence Oluyede | last post by:
Is there a way to treat html tags like simple text? I explain myself, if I have a bunch of xml like <content type="application/xhtml+xml" xml:base="http://loluyede.blogspot.com" xml:lang="en-US"...
2
by: VMI | last post by:
If I have an XML document, how can I find out what the contents of a certain tag is? For example, if I have this: <?xml version="1.0" standalone="yes"?> <NewDataSet> <Table1>...
1
by: adhag | last post by:
Hi I have an app that uses xpath to read an xml document. The problem is a 70meg file uses 1.5 gig of memory. What I really need is to read only chunks of the file at a given time and cannot...
4
by: PaulF | last post by:
How do I identify all of the namespace / prefix pairs associated with an XML document I am reading? Thanks for any help. Paul
5
by: prasanta | last post by:
Hello, I have a xml file. when i am trying to load through XPathDocument and try to get XPathNodeIterator its not working . my xml is loking like <?xml version="1.0" ?> <?mso-application...
14
by: Rob Meade | last post by:
Hi all, I'm working on a project where there are just under 1300 course files, these are HTML files - my problem is that I need to do more with the content of these pages - and the thought of...
3
by: apiringmvp | last post by:
All, So I am creating a function that gets a short blurb of html from a blog. I would like to retain all html formating and images. The code below works well, with the exception of one issue....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.