From: Oleg T. <he...@us...> - 2004-10-30 09:56:38
|
Update of /cvsroot/mvp-xml/XInclude/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26849/v1/src Modified Files: XIncludingReader.cs Log Message: Updated Test Suite and added non-streaming mode tests. Index: XIncludingReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/src/XIncludingReader.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- XIncludingReader.cs 28 Oct 2004 18:39:23 -0000 1.19 +++ XIncludingReader.cs 30 Oct 2004 09:56:27 -0000 1.20 @@ -1457,9 +1457,24 @@ /// </summary> /// <param name="xpointer">Required XPointer pointer</param> private bool ProcessIntraDocXMLInclusion(string xpointer) - { - //TODO: So? - return false; + { + //Include current document as XML + CheckLoops(null, xpointer); + //No XML resolving for intra-doc references + //Push current reader to the stack + _readers.Push(_reader); + //For an intra-document reference (via xpointer attribute) + //the source infoset is used as the acquired infoset. + IHasXPathNavigator hxn = _reader as IHasXPathNavigator; + if (_reader != null) + { + XPathNavigator nav = hxn.GetNavigator(); + nav.MoveToRoot(); + _reader = new XPointerReader(nav, xpointer); + return Read(); + } + else + throw new InvalidOperationException("How on earth this could happen?"); } /// <summary> @@ -1471,7 +1486,7 @@ { //Include document as XML Uri includeLocation = ResolveHref(href); - CheckLoops(includeLocation); + CheckLoops(includeLocation, xpointer); if (includeLocation.Fragment != String.Empty) throw new FragmentIdentifierInHrefAttribute(); if (_xmlResolver == null) @@ -1500,8 +1515,7 @@ else _reader = CreateInMemoryReader(r); } - bool res = Read(); - return res; + return Read(); } else { @@ -1641,9 +1655,8 @@ /// <summary> /// Checks for inclusion loops. - /// </summary> - /// <param name="url"></param> - private void CheckLoops(Uri url) + /// </summary> + private void CheckLoops(Uri url, string xpointer) { //Check circular inclusion if (new Uri(_reader.BaseURI).Equals(url)) |