[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Why does Chrome's XSL processor validate my XML fi

Subject: Re: Why does Chrome's XSL processor validate my XML files when processing them, and how can I make it stop doing that so that it processes them faster?
From: "Peter Flynn peter@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 21 Feb 2021 11:10:42 -0000
Re:  Why does Chrome's XSL processor validate my XML fi
On 21/02/2021 02:00, Wolfhart Totschnig wolfhart.totschnig@xxxxxxxxxxx wrote:
I have made a couple of changes to my project in the last couple of days. The project mainly consists in many small XML files that I
write with an XML editor but read with a web browser (Chrome). That
is, I have an XSL stylesheet that transforms these XML files into
HTML and which is executed by the browser when loading the files.
Now, one of the changes I made is to switch from a DTD to an XSD for
my XML files. And the problem is that now the browser loads the files
noticeably more slowly.
Does the XSLT *require* validation of the XML? This is usually only true if the DTD contains entity declarations or default attribute values which are actually used in the XML document[s].

What happens if you remove all reference to a Schema or DTD?

Concretely, I see a white screen for a fraction of a second before the file is displayed. I am very puzzled by this. I would have thought that switching from a DTD to an XSD would not have any effect on the performance of the XSL processor because the processor would ignore the associated DTD or XSD, respectively.

I would certainly expect a difference in performance or behaviour between *loading* a document referencing a DTD and the same document referencing an XSD, but I wouldn't expect it to be visible or even noticeable to the user.


What then happens when the browser gets to the stage of loading and interpreting the XSLT may depend on whether a DTD or an XSD or neither was used in the document,

But apparently that is not the case. Hence my question: Why does
Chrome's XSL processor validate my XML files when processing them? I
don't understand why it would do that.
I think it has to, in case you have used features which only work for valid documents, or (in the case of a DTD) make use of entity references and potential default attribute values.

I just want the processor to execute the code, i.e., transform the
XML into HTML. Also, and more importantly, is there a way -- a line
of code that I could add to the XSL stylesheet -- that would make it
stop validating the files and hence process them faster?

Possibly, but this will break the process if the document requires features only available in valid documents.


1) Since I made several changes to my project, I am not 100 % certain that the drop in performance was caused by the switch from DTD to XSD. But I think that I have excluded all other possibilities by reversing the changes step by step. So I am 95 % certain that this is where the problem lies.

Please test it without either DTD or XSD and let us know.


2) I could not test the issue with another web browser because Chrome is the only browser that I can get to execute the stylesheet at all. All other browsers that I have tried refuse to execute the stylesheet on my local XML files, supposedly for security reasons.

Ah. Browsers do all sorts of weird things, especially with XML. One way around this is to install Apache and serve the documents locally as http://localhost/...


Peter

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.