From: Oleg T. <he...@us...> - 2004-11-09 12:23:23
|
Update of /cvsroot/mvp-xml/WebSite/xpointer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21807/xpointer Modified Files: index.html Log Message: fixed documentation Index: index.html =================================================================== RCS file: /cvsroot/mvp-xml/WebSite/xpointer/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.html 1 Nov 2004 17:42:04 -0000 1.2 +++ index.html 9 Nov 2004 12:23:12 -0000 1.3 @@ -1,11 +1,11 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> - <title>Mvp.Xml project: Common module</title> + <title>Mvp.Xml project: XPointer.NET module</title> <link href="../style.css" type="text/css" rel="stylesheet"> </head> <body> -<h1>Mvp.Xml Project: XPointer.NET module (version 1.3)<br> +<h1><a href="../index.html">Mvp.Xml Project</a>: XPointer.NET module<br> </h1> The XPointer.NET module provides an implementation of the <a href="http://www.w3.org/TR/xptr-framework/">XPointer Framework @@ -18,12 +18,20 @@ XPointer xpath1() Scheme</a> and <a href="http://www.w3.org/TR/xptr-xpointer/"> XPointer xpointer() Scheme</a> (XPath subset only). XPointer.NET was -designed and implemented for XInclude.NET module, but it can be used on +designed and implemented for the <a href="../xinclude/">XInclude.NET +module</a>, but it can be used on its own.<br> <h2>Requirements</h2> <p>XPointer.NET is .NET Framework application and requires <a href="http://msdn.microsoft.com/netframework/" target="_top"> .NET -Framework</a> version 1.0 or 1.1 to be installed. </p> +Framework</a> version 1.0 or 1.1 to be installed.<br> +</p> +<h2>Download</h2> +Go to the <a + href="http://sourceforge.net/project/showfiles.php?group_id=102352">Downloads</a> +page. You can download XPointer.NET module separately (with no +dependencies on other modules) or as part of the Mvp.Xml library +release (all modules in one). <h2>Installation and Documentation</h2> <p>Find precompiled <font style="font-family: monospace;" face="Courier New">Mvp.Xml.XPointer.dll</font> library in the "<font @@ -32,12 +40,16 @@ face="Courier New">src</font>" directory contains XPointer.NET sources in Visual Studio <br> .NET 2003 solution form. The API documentation can be found in the "<span - style="font-family: monospace;">doc</span>" directory (online version) -(#TODO). Test cases can be found in the "<span - style="font-family: monospace;">test</span>" directory.<br> + style="font-family: monospace;">doc</span>" directory (<a + href="../api/">online version</a>). Samples and test cases can be +found in the "<span style="font-family: monospace;">test</span>" +directory.<br> In addition to the API documentation, refer to the "<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/xinclude.asp">Combining -XML Documents with XInclude</a>" article at the MSDN and the normative +XML Documents with XInclude</a>" article at the MSDN, which introduces +XPointer itself and provides details on usage and implementation of the +XPointer.NET module<span style="font-family: monospace;"></span>. +Additionally doen't forget the normative specs:<br> </p> <ul> @@ -53,19 +65,24 @@ <h2>History</h2> Done since 1.2 release:<br> <ul> - <li>The new home - Mvp.Xml project and so the new namespace - -Mvp.Xml.XPointer instead of GotDotNet.XPointer.<br> + <li>The new home - <a href="http://mvp-xml.sf.net/">Mvp.Xml project</a> +and so the new namespace - + <a + href="file:///D:/projects/Mvp.Xml/WebSite/api/Mvp.Xml.XPointer.html">Mvp.Xml.XPointer</a> +instead of GotDotNet.XPointer.</li> + <li>Performance improvements - documents processed are +now cached, all XPath expressions used internally are compiled and +cached via the <a href="../api/Mvp.Xml.Common.XPath.XPathCache.html">Mvp.Xml.Common.XPath.XPathCache</a> +class.<br> </li> - <li>Performance improvements - documents included via XPointer are -now cached.</li> - <li>Memory footprint is minimized.</li> + <></> <li>Memory footprint is minimized.</li> <li>XPointer Framework syntax erorrs are now throw exceptions.<br> </li> </ul> <h2>Usage</h2> -<a - href="../../../../temp/XInclude.NET-1.2/doc/GotDotNet.XInclude.XIncludingReader.html">XPointerReader</a> -class (#TODO), found in the Mvp.Xml.XPointer namespace (#TODO), is the +<a href="../api/Mvp.Xml.XPointer.XPointerReader.html">XPointerReader</a> +class, found in the <a href="../api/Mvp.Xml.XPointer.html">Mvp.Xml.XPointer +namespace</a>, is the key class. It's customized <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXmlReaderClassTopic.asp"> @@ -80,11 +97,90 @@ XPointer xpointer() Scheme</a> (XPath subset only) in a caching forward-only fashion.<br> <br> -[#TODO samples] <br> +Usage samples:<br> <br> -Find more examples and test cases in the "<font - style="font-family: monospace;" face="Courier New">test</font>" -directory.<br> +1. Basic identifying of subresources using XPointer: +<br> +<span style="font-family: monospace;">XPointerReader r = </span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> new +XPointerReader("books.xml", +"xpointer(//book)"); +</span><br style="font-family: monospace;"> +<span style="font-family: monospace;">while (r.Read()) </span><span + style="font-family: monospace;"></span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> +Console.WriteLine(r.ReadOuterXml());</span><span + style="font-family: monospace;"></span><br + style="font-family: monospace;"> +<span style="font-family: monospace;">r.Close();</span><br> +<br> +2. Running <span style="font-family: monospace;">XPointerReader</span> +on an in-memory XML store:<br> +<br> +<span style="font-family: monospace;">XPathDocument doc = new +XPathDocument("books.xml");</span><br style="font-family: monospace;"> +<span style="font-family: monospace;">XPointerReader r = </span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> new +XPointerReader(doc, +"xpointer(//book)"); +</span><br style="font-family: monospace;"> +<span style="font-family: monospace;">while (r.Read()) </span><span + style="font-family: monospace;"></span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> +Console.WriteLine(r.ReadOuterXml());</span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"></span><span + style="font-family: monospace;">r.Close();</span><br> +<br> +or <br> +<br> +<span style="font-family: monospace;">XmlDocument doc = new +XmlDocument();</span><br style="font-family: monospace;"> +<span style="font-family: monospace;">doc.Load("books.xml");</span><br> +<span style="font-family: monospace;">XPointerReader r = </span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> new +XPointerReader(doc, +"xpointer(//book)"); +</span><br style="font-family: monospace;"> +<span style="font-family: monospace;">while (r.Read()) </span><span + style="font-family: monospace;"></span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> +Console.WriteLine(r.ReadOuterXml());</span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"></span><span + style="font-family: monospace;">r.Close();</span><br> +<br> +3. When running <span style="font-family: monospace;">XPointerReader</span> +on <span style="font-family: monospace;">XPathDocument </span>or <span + style="font-family: monospace;">XmlDocument</span>, you can get +underlying <span style="font-family: monospace;">XPathNavigator</span> +via <span style="font-family: monospace;">IHasXPathNavigator</span> +interface:<br> +<span style="font-family: monospace;">XPathNavigator nav = +((IHasXPathNavigator)reader).GetNavigator();</span><br> +<br> +4. Namespace-aware XPointers:<br> +<span style="font-family: monospace;">XPointerReader r = </span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> new +XPointerReader("books.xml", +"xmlns(bk=http://books.com)xpointer(//bk:book)");</span><br> +<br> +5. Fallback-like XPointers. Recall that XPointer can consist of a +several pointer parts, which are evaluated in turn until one identifies +any subresource. That property can be used to create more reliable +XPointers:<br> +<span style="font-family: monospace;">XPointerReader r = </span><br + style="font-family: monospace;"> +<span style="font-family: monospace;"> new +XPointerReader("books.xml", +"element(bk101)xpointer(//book[@id='bk101'])");</span><br> <h2>Conformance Issues<br> </h2> <ol> @@ -93,8 +189,8 @@ XPointer xpointer() Scheme</a> is currently supported. </li> </ol> <h2>License</h2> -<p>XPointer.NET as part of the Mvp.Xml project is subject to the <a - href="../license.html">Common +<p>XPointer.NET as part of the <a href="http://mvp-xml.sf.net/">Mvp.Xml +project</a> is subject to the <a href="../license.html">Common Public License</a> - <a href="http://www.opensource.org/licenses/index.php">OSI approved</a> free open-source license. @@ -115,7 +211,7 @@ the <a href="https://lists.sourceforge.net/mailman/listinfo/mvp-xml-help">mvp-xml-help</a> mailing list <a - href="http://sourceforge.net/mailarchive/forum.php?forum=mvp-xml-help">(archive)</a>. + href="http://sourceforge.net/mailarchive/forum.php?forum=mvp-xml-help">(archive)</a>.<br> </p> <hr style="width: 100%; height: 2px;"> <p> The project is hosted at <a target="_blank" |