OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] IE and XML schema

[ Lists Home | Date Index | Thread Index ]

>I am sorry I should describe my problem more precisely. I know how to
>schema and how to associate schema with XML document (xml file). The
>that I want user to open XML document in IE, no VB no JavaScript. And I
>IE to validate XML document against schema, not just to perform
>well-formedness check. After it was validated associated default
>will be applied and user will see it as HTML in the browser. I am able
to >do
>that. Everything works fine just browser doesn't use XML Schema to
>XML document. Thanks

I don't know exactly what you want here, but let us suppose that you
want to have a processing-instruction <?xsdl-schema myschema.xsd?> that
you can put into any xml document that needs to have myschema.xsd
associated with it. 

If you open an xml document in the browser without an xsl-stylesheet
associated with it the defaultss.xsl is used, this stylesheet is an
older wd-xsl file found inside of msxml3.dll as a resource, you can
replace this file if you want and add your own functionality, the way to
do this is to get a program that gives you access to the resources
inside of an .dll or .exe, in my case I use reshack.exe. 
Open up msxml3.dll with reshack.exe, you will see a folder structure
similar to what you see in windows explorer, there will be a folder
called 23, when you click that open there will be a folder called
DEFAULTSS.XSL and under that will be a funny little icon that says 1033;
this key holds the actual xsl file which you can then replace with an
xslt more to your liking.

I know of course that you don't want to use javascript or vbscript to do
schema validation but if you look throughout this wd-xsl you will see
that this is probably exactly what you will have to do. The idea of
course is that you can write the script, pass it the entire xml document
as parameter and get the schema name by checking against the xsdl-schema
pi. Note I've never tried this but unless there should be security
restrictions I can't see any problems. 

Once you have a stylesheet that works (I recommend testing it by just
running it against the xml documents you want to test), overwrite the
stylesheet in msxml3.dll, press the compile script button, save as
msxml3backup.dll in your system32 folder, make sure you stop all
processes that are currently using msxml3.dll, delete msxml3.dll and
rename msxml3backup.dll as msxml3.dll. Note the first time you actually
try to load an xml document into IE after doing this it will take 10 or
15 seconds.

This by the way is dangerous stuff and if anything goes wrong I disavow
any responsibility :) however it has allowed me to provide functionality
more in keeping with my own needs for generic xml documents in IE and I
suppose that it can help others to do the same.


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS