MS XML Strange Error

xml

    Next

  • 1. C++ executable
    "Weldon" < XXXX@XXXXX.COM > wrote... > I'm looking for some simple HTML coding to invoke a C++ > executable application within a website based on IE. Can > anyone help? <a href="path-to.exe">Foo</a> Or did ytou want the exe run server side?
  • 2. performance question
    I have an asp site where XML is transformed server side into html. Now I'm wondering about the performance difference between generating a big XML string with vbscript and transform that or generate a small string and add nodes to the Document object with appendChild? So this? Dim s s = "<bigxml>...." s = s & "<url>url</url>" s = s & "</bigxml>" Or this? Set newnode = xmlDoc.createNode(1, "url", "") ' append the url to the result xml newnode.text = url xmlDoc.documentElement.appendChild newnode
  • 3. How to get Attribute Name as values
    I want to get the attribute name as values in a xsl.. How can I do this , the sample of the raw file and output I need are given below. Here I have taken just 2 as attributes but their can be many attributes so I need to store and loop it through within which using the if condition to check if its not the one which I am using as hardcoded one like here I have used reserve and ceiling, which are fixed and hardcoded in xsl. and apart from these 2 attributes will come under the attribute node of final xml with innerxml as name Please see below.. I have an xml : <SFL> <row reserve=1 ceiling=Yes region=USA laminate=FR1/> <row reserve=43 ceiling=No region=USA laminate=FR1/> </SFL> I want : <SFL> <Ceiling>Yes</Ceiling> <Reserve>1</Reserve> <Attributes> <Attribute> <Name>region</Name> <Value>USA</Value> </Attribute> <Attribute> <Name>laminate</Name> <Value>FR1</Value> </Attribute> </Attributes> <Ceiling>No</Ceiling> <Reserve>43</Reserve> <Attributes> <Attribute> <Name>region</Name> <Value>CA</Value> </Attribute> <Attribute> <Name>laminate</Name> <Value>FR2</Value> </Attribute></Attributes> </SFL>
  • 4. why xml:space cannot be set as 'none'
    hi, everyone i am doing an XSLT on XML thing now. in my XML file, there are some <item>'s inside a <group>, what i want to go in my XSLT file is to add some special effects on the first <item>, like this <xsl:template match='item'> <div ...> <xsl:attribute name="class"><xsl:choose> <xsl:when test="position()=1">first</xsl:when> <xsl:otherwise>others</xsl:otherwise> </xsl:choose></xsl:attribute> .... </div> </xsl:template> this works well in IE but fail for Mozilla, and i find out that's because the newline between the <group> and the 1st <item> is also counted in Mozilla, so that the first <item> actually has a position()=2 there. in fact the 'default' value of xml:space means 'none' in IE and 'preserve' in Mozilla. i can set xml:space to 'preserve' to make IE also regard the 1st <item> has a position() of 2, but why cannot i set xml:space to 'none' to let Mozilla regard 1st <item> has position() as 1. why xml:space can only take 2 values (default and preserve)?. must i test position()=2 later? that's silly. speedo goo
  • 5. Filtering several columns with XSLT
    I have a XML file with the following structure <root> <row attribute="1"> <author>Author 1</author> <title>Title 1</author> </row> <row attribute="0"> <author>Author 1</author> <title>Title 2</author> </row> <row attribute="1"> <author>Author 2</author> <title>Title 3</author> </row> </root> I have a XSLT file which creates three comboboxes (author, title and attribute). The comboboxes are used to filter the XML. I can filter on "Author 1", "Author 2", etc, but also "All Authors". The same for the other two comboboxes. <xsl:apply-templates select="row[author=$Author and @attribute=$attribute and title=$title]"> doesn't work when I choose one of the "All" options in the combobox (which generates an empty string in the variable). How can I solve this problem without having to write all the combinations of choices (with this example you have 9 combinations and I want to have a total of 5 comboboxes, thus 25 combinations). Sweetpea

MS XML Strange Error

Postby Gadrin » Fri, 21 Oct 2005 14:02:12 GMT

I have a page that was converted to XHTML via XMLStarlet.

I tried to load the page into a MS XML 3.0 Document but get the
following error:

Error Code: -1072896758
Reason: The character '>' was expected.
Line: 31 Column: 3
Text:   -- Typical usage:

Now that text isn't even in the page! However there are numerous
comments with the double -- so I went a removed each by hand.

I still get the error.

So I completely removed line 31 (it was one of the comments that I
removed above)...and I still get the error.

I've noticed MS XML is a bit flaky with errors in the past (I've seen
it die before it actually reaches the Column of text that caused the
error).

Anyone feel like eyeballing the XHTML file via email? It's 52K.

Or better yet here's the original page's URL (I'm retrieving it via
XMLHTTP)

url =
" http://www.**--****.com/ ,,11&nodeid=3&showintro=&soccode=&stfips=00&group=2"

this is line 31:
	<!--td width="157" valign="middle" align="RIGHT"
background="./images/acinetbottom.jpg"
style="background-repeat:no-repeat;"><a
href=" http://www.**--****.com/ " class="help">Site
Map</a> | <a
href=" http://www.**--****.com/ "
class="help">Help</a> </td-->

...which I've completely removed...


Re: MS XML Strange Error

Postby Martin Honnen » Fri, 21 Oct 2005 21:58:57 GMT







Well post the URL to that XHTML but consider checking it with various 
validators around yourself:
   < http://www.**--****.com/ ;
   < http://www.**--****.com/ ;


-- 

	Martin Honnen --- MVP XML
	 http://www.**--****.com/ 

Re: MS XML Strange Error

Postby Gadrin » Sat, 22 Oct 2005 02:41:04 GMT

Unfortunately I don't have a web-site I can post the page to.

XMLStarlet's validation says it's Valid when using the default option.

However when I validate it versus the dtd, XMLStarlet returns
"invalid".

using W3C gets
Result: Failed validation,
File: J:\Temp Folders\CodingTemp\Winbatch BBS\xh1.html
Encoding: us-ascii
Doctype:

Sorry, I am unable to validate this document because on line 25, 37,
42, 44, 166, 177, 179, 229, 235-237, 250-252, 254-255, 258-260,
262-263, 266-268, 270-271, 274-276, 278-279, 282-284, 286-287, 290-292,
294-295, 298-300, 302-303, 306-308, 310-311, 314-316, 318-319, 322-324,
326-327, 330-332, 334-335, 338-340, 342-343, 346-348, 350-351, 354-356,
358-359, 362-364, 366-367, 370-372, 374-375, 378-380, 382-383, 386-388,
390-391, 394-396, 398-399, 402-404, 406-407, 410-412, 414-415, 418-420,
422-423, 426-428, 430-431, 434-436, 438-439, 442-444, 446-447, 450-452,
463, 466-470, 474 it contained one or more bytes that I cannot
interpret as us-ascii (in other words, the bytes found are not valid
values in the specified Character Encoding). Please check both the
content of the file and the character encoding indication.

Which doesn't help me a whole helluva lot. Guess I need to scan
character-by-character for non-Ascii.


Re: MS XML Strange Error

Postby Gadrin » Sat, 22 Oct 2005 03:58:16 GMT

Alright, thanks for your help Martin.

I went char by char on the file and replaced chr(194) and chr(160) with
their corresponding   etc.

Unfortunately that didn't work as a subsequent validation revealed two
more errors.

So another char by char search determined all of these are problem
chars.

NAList = "160|194|226|128|148|169"

So I replaced all of those and still get an error.

Missing "charset" attribute for "text/xml" document. The HTTP
Content-Type header (text/xml) sent by your web browser (Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1)) did not contain a "charset"
parameter, but the Content-Type was one of the XML text/* sub-types.

The relevant specification (RFC 3023) specifies a strong default of
"us-ascii" for such documents so we will use this value regardless of
any encoding you may have indicated elsewhere.

If you would like to use a different encoding, you should arrange to
have your browser send this new encoding information.



So I think I'm getting close.

Thanks, for your help.


Re: MS XML Strange Error

Postby Peter Flynn » Sat, 22 Oct 2005 09:27:22 GMT



" http://www.**--****.com/ ,,11&nodeid=3&showintro=&soccode=&stfips=00&group=2"

The original HTML is hopelessly invalid, and even Tidy refuses to convert it
("588 warnings, 26 errors were found!") so I have no idea what kind of fist
XMLStarlet is making of it. Can you post the whole file so we can see it?


In itself the comment is well-formed. In these cases, always save the file
to disk and validate it using one of the well-known, robust standalone
parser/validators, eg rxp, onsgmls, etc. These are known to give accurate 
and explicit error messages.

///Peter
XML FAQ:  http://www.**--****.com/ 


Re: MS XML Strange Error

Postby Gadrin » Sat, 22 Oct 2005 10:22:14 GMT

well, actually I got it to work.

XMLStarlet seems to do a better job that Tidy (I used both Tidy and
TidyCOM).

If you use XMLStarlet's   -o (omit XML Declaration) and -D (omit
DOCTYPE) it becomes quasi-XML.

I then open the XML file as a text file, removed all NULLS and then
went through and changed each chr() into it's
corresponding numeric entity code so

chr(194) gets changed to  and then resave the file.

that done, it opens in MS XML 3.0 just fine.


Re: MS XML Strange Error

Postby Gadrin » Sat, 22 Oct 2005 10:33:03 GMT

BTW Peter just in case you're looking...you can get XMLStarlet at

 http://www.**--****.com/ 

I think it does a better job than Tidy. You can use it on http:// pages
or local files.
I like it too because it has XSLT and EXSLT built into it. I just wish
it had a COM interface.

and another neat tool is XStandard's XHTTP component which is similar
to XMLHTTP but
has Tidy built into it and returns XHTML or text as you need. It only
works on http:// pages, though.

 http://www.**--****.com/ 


Similar Threads:

1.Strange Map Compile Errors using External XSLT

2.Strange XMLA error

When trying to use XMLA locally, it fails (note it does work when I access 
url from a different computer)

In the application event log, I find:



The description for Event ID ( 10 ) in Source ( MSOLAP ISAPI Extension: 
\\?\c:\inetpub\wwwroot\olap\msmdpump.dll ) cannot be found. The local 
computer may not have the necessary registry information or message DLL 
files to display messages from a remote computer. You may be able to use the 
/AUXSOURCE= flag to retrieve this description; see Help and Support for 
details. The following information is part of the event: .


3.Very Strange XML/A Error - Nothing in Google

4.Strange error validating XML against XSD

Hello,

I've developed a .NET C# web service; which has one method named, let's say, 
upload_your_data. This method has one parameter ( string your_data). The 
value that this parameter will actually have is the content of a XML 
document. This data will be processed and check for a well-formed xml 
document and will be validated against a XSD. Before putting my code, let me 
go on and explain the whole situation.

This web method is invoked by some guys outside my organization and they are 
using java applications (jsp's it seems to be).
I've tested my web method locally (intranet) from the test page (the one 
with the "invoke" button) and works fine. Also, I have tested my web service 
using a .NET Windows App which loads a XML file and invokes the web method to 
upload the content of the file and works perfectly. Moreover I tested the web 
service with this windows app from my home connected to the internet via my 
ISP and invoking the web method directly from my company's web server. This 
test was also completed successfully.
And, if this is not enough testing, I enabled the httpget and httppost 
methods to enable the web method to be tested remotely using the test page. 
I've done this with some of my friends.

However these guys from this other company, have a java application which 
invokes my web method and it fails exactly when the XSD is performed. It 
throws this error: The data at the root level is invalid. Line 1, position 1.

If, for example the content of the XML is simply: 

<this is my 
nam<

I receive exactly that string (I check the value of the web method's 
parameter: your_data, which is a string variable) when testing the web method 
with my testing apps. But when these guys invoke the method, the value that I 
get from them is:

<this is my 
name<

Instead of the first one (the one that you can read "normally"). And not to 
mention the characters for all the "special" Spanish letters that will appear 
when more tags are present.
What can be wrong? Is it me or they ? The one responsible for receiving or 
sending the context is such way. I don't know how they generate the xml 
document, whether it's stored on a database or loaded from a physical file.
These guys say that I'm not applying the "right encoding" to the data that 
they're sending; but fail to answer me which one they're using.

Please help. 

This is my web methods code:

[WebMethod]
public string upload_your_data(string your_data)
{
   StringReader srReaderXML; 

   try
   {
      //
     // reading the xml doc
     //
     srReaderXML = new StringReader(your_data);
     //
     // loading the XML (check for a well-formed doc) and XSD
    //
     XmlTextReader xtrDocXML = new XmlTextReader(srReaderXML);
     XmlTextReader xtrDocXSD = new XmlTextReader
     (ConfigurationSettings.AppSettings["XSDPath"].ToString() + 
     ConfigurationSettings.AppSettings["XSDFileName"].ToString());
    //
    // loading the schema (XSD)
    //
    XmlSchema xsDocXSD = new XmlSchema();
    xsDocXSD = XmlSchema.Read(xtrDocXSD,null);
    XmlSchemaCollection xscSchemaColeccion = new XmlSchemaCollection();
    xscSchemaColeccion.Add(xsDocXSD);
    //
    // validating the XML doc against the XSD
    //
    XmlValidatingReader xvrValidatorDocXML = new XmlValidatingReader
    (xtrDocXML);
    xvrValidatorDocXML.Schemas.Add(xscSchemaColeccion);
    xvrValidatorDocXML.ValidationType = ValidationType.Schema;
    while(xvrValidatorDocXML.Read()); // the exception is thrown here
    xvrValidadorDocXML.Close();
    
    return "this is right"
  }
  catch(Exception ex)
  {
     return "this is wrong + ex.Message;
  }
}

Thank you !!
Cesar

5.Very strange error: CLR has been unable to transition from COM context

I ran into a very strange error tonight. I was working with web services 
and typed datasets. The web server I was using happens to be on the 
other end of a virtual network (Hamachi).

Everything was working fine. I added one more row of data to the table 
and all of a sudden one web method started failing. I initially thought 
the web service was timing out but after a while the following exception 
was thrown:

The CLR has been unable to transition from COM context 0x1a2008 to COM 
context 0x1a2178 for 60 seconds

I thought there might be some funny stuff going on since it was working 
fine just moments ago. So, I rebooted both boxes, tried VS 2005 and 
VS2003 on the client end. (VS2003 is running on the web server side.) 
The client would not work remotely, but if I ran the client locally on 
the server, it would work fine.

I was running out of ideas and decided to delete the last couple rows I 
added from the database and everything started working again. Crazy. I 
hope this doesn't happen in production -- can't really just delete 
production rows to get something to work. (There was nothing odd about 
the data, no SQL injection etc.)

I believe the line of code it was failing on (and hence the post in this 
newsgroup) was in the web reference generated code:
        protected override void ReadXmlSerializable(XmlReader reader) {
            this.Reset();
            DataSet ds = new DataSet();
            ds.ReadXml(reader);  // <------------ CRASH HERE
            if ((ds.Tables["OrganizationList"] != null)) {
                this.Tables.Add(new OrganizationListDataTable(ds.Tables
["OrganizationList"]));
            }
            this.DataSetName = ds.DataSetName;
            this.Prefix = ds.Prefix;
            this.Namespace = ds.Namespace;
            this.Locale = ds.Locale;
            this.CaseSensitive = ds.CaseSensitive;
            this.EnforceConstraints = ds.EnforceConstraints;
            this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
            this.InitVars();
        }

The fact that it was happening in both 2003 and 2005 makes me think 
there is something going wrong in the XML stack somewhere, but that's 
just a wild guess.

I thought I would post this incase other people get the same error. Good 
luck!

-- 
Don Rixtown
don[dot]rixtown[at]gmail[dot]com

6. Strange error validating XML against XSD

7. Strange error

8. Getting a strange error when I try to view an XML file from VS.NET



Return to xml

 

Who is online

Users browsing this forum: No registered users and 45 guest