Basic Search  Advanced Search   
Topics Resources Free Library Software XML News About Us
   Ask PerfectXML
   .NET XML KB Articles
   XML Certification
   Events Calendar
   Product Reviews
   Book Reviews
   Books & Magazines
   Getting Help
   Microsoft & XML
  Sample Chapters
   By Subject
   By Publisher
   Web Services
   Native XML Databases
   Web Services
   XSLT Editors
   XML Editors
   Development Tools
   Contact Us

home » info bank » Perfect Solution Mon, Nov 26, 2007
Perfect Solution

Q:  When I browse an XML document in Internet Explorer 5.0, it shows a nice hierarchical color-coded view of my XML document, how does Internet Explorer do that?

When you open an XML document in Internet Explorer, if the XML document does not specify a stylesheet (XSL or CSS), Internet Explorer uses a default stylesheet. You can actually see how this default stylesheet looks like by typing res://msxml.dll/defaultss.xsl in the address (location) bar in Internet Explorer. If you have MSXML version 3.0 installed, type res://msxml3.dll/defaultss.xsl to view the default stylesheet.
You can incorporate this default stylesheet in your applications. Click here to download default XSL stylesheet used by Internet Explorer for viewing XML documents.

More Information:
Q282127 PRB: Browsing and Saving the Default MSXML XSL Stylesheet in Internet Explorer

Also see:

Q:  I need to convert my XML documents to PDF format. Is it possible, if yes, how?

The answer is Yes. It is possible to conver XML files to PDF format. Let's first look at the tools that help in conversion.
RenderX   FOP from Apache   Unicorn Formatting Objects
Essentially, the steps to convert XML to PDF format include creating XSL-FO that instructs FOP Parser on how to layout your XML and next using one of above tools to do parsing and actually converting your input XML to PDF.

More Information:
Chapter 9 from book Java and XML: Web Publishing Frameworks
Chapter 15 from book XML Bible: XSL Formatting Objects

Q:  Which version of MSXML supports XSLT 1.0?

MSXML 3.0 supports XSL Working Draft and also is highly compliant with the XSLT Specification. However, we would recommend installing MSXML 4.0 on the client, and specifically using it through client side scripting. For more information read the article at

Q:  I need to populate a tree-view control using an XML file. What's the solution?

We recommend reading following articles to learn how to populate tree-view control with an XML file.
Q244954: Populate a Treeview Control with an XML File
How to load a tree view with a large XML file

Q:  I need to convert ADO Recordset to an XML document and again convert XML document back to ADO Recordset.

Check following KB Articles:
Q252767 Get XML Representation Of an ADO Recordset
Q263247 Obtain an ADO Recordset from XML

Q:  I wish to use a variable in all of my templates in the XSLT document. I mean, is it possible to use "global variables" in an XSL stylesheet?

The answer is Yes. Variables and parameters defined as [children] of an xsl:stylesheet element are global in scope and are visible across all templates. But note that there is no way to modify the value of a variable or parameter once it has been defined. This is because XSLT is a functional programming language, not an imperative one like C++ or Java. Also, it is good to remember that a template can hide the global definition by defining a variable or parameter with the same name, see example below:

<xsl:stylesheet version='1.0' xmlns:xsl=''>
   <xsl:param name='Age' select='25' />
    <xsl:template name='Uncle Joseph'>
        <xsl:variable name='Age' select='80'/>

Q:  Can I include MSXML DLL(s) directly into my setup program?

The answer is MSXML 3.0 MergeModule Redistribution Package
Also see: MSXML 3.0 .cab File Redistribution Package

Q:  I need to convert RTF documents to XML. Any solution?

There is a tool available which can help convert RTF files to XML. Check Logictran RTF Converter

Q:  What is the difference between VoiceXML, VXML, VoXML, and all the other voice mark up languages?

Historically, different speech companies created their own voice markup languages with different names. As companies integrated languages together, new names were given to the integrated languages. The IBM original language was SpeechML. AT&T and Lucent both had a language called PML(Phone Markup Language, but each had different syntax. Motorola's original language was VoxML. IBM, AT&T, Lucent, and Motorola formed the VoiceXML Forum and created VoiceXML (briefly known as VXML). HP Research Labs created TalkML. The World Wide Web Consortium Voice Browser Working Group has specified DialogML, using VoiceXML as a model.

Check WAP-WML focus section for more detials.

Q:  What version(s) of MDAC support saving Recordset as XML files.

MDAC version 2.1 first introduced support for persisting ADO Recordset in XML format to a file on the disk (using Save method). MDAC 2.5 extended this facility to load DOM document directly from an ADO recordset.

Check Q264869 for more details.

Q:  I am using MSXML as a DOM Parser. To create the DOM Document object should I use Msxml2.DOMDocument or Msxml2.FreeThreadedDOMDocument?

MSXML offers two threading models:

Rental model: The rental model version is designed for single-threaded access. To use the rental model control, use the "Microsoft.DOMDocument" progID.


Free-threaded model: The free-threaded version is designed for multiple thread access. To use the free-threaded control, use the "Microsoft.FreeThreadedDOMDocument" progID.

If you plan for several threads to access your XML data from a single document object, be sure to use the free-threaded model. If only one thread will access the XML data, use the rental model for better performance.

To Summarize: Use FreeThreadedDOMDocument if you are going to use it at application level (ex: in global.asa) or you'll be sharing the nodes off the tree and pass them to other threads to do some processing. The FreeThreadedDOMDocument is built for safety in concurrent environments, so it has some overhead involved, hence don't use it if you just want to load, parse and throw away single XML document in a single thread.

Check Inside MSXML3 Performance for more details.

Q:  I am using SQL Server's XML features, and all of sudden they stopped functioning. I get different error message, but none of XML features (ex: FOR XML, http based tempate access, etc.) work. Please help me.

The most probable cause of this happening is running MSXML 3.0 in replace mode. Check MSXML version detector page to see if you have MSXML 3.0 installed in replace mode. Remember that SQL Server 2000 uses MSXML 2.6 and installing MSXML 3.0 in replace mode may produce unexpected results. Here is how you can fix this problem: First try to stop IIS Services (administrator service and WWW service) and SQL Server (MSSQLServer) service - if you can, not an required step. Go to DOS command prompt and run following set of commands which set MSXML in side-by-side mode:
1.) First command to remove all entries for MSXML
xmlinst.exe -u

2.) Register MSXML DLLs back

regsvr32 msxml.dll

regsvr32 msxml2.dll

regsvr32 msxml3.dll

This will bring MSXML as side-by-side install. Now try your SQL Server XML code and it should work fine.

Q:  When I use the FOR XML clause with the SELECT statement in SQL Server 2000, and my column list has a DATETIME type field, I get the element value as [Date]T[Time] (for ex: 1996-07-04T00:00:00). How do I get the date in mm/dd/yy format?

The trick is to use the CONVERT function with 101 style (USA format date). So the solution would be use:

USE NorthWind
SELECT CONVERT (CHAR(10), OrderDate, 101) 
	AS OrderDate
	FROM Orders 
	WHERE OrderID = 10248

  Contact Us | E-mail Us | Site Guide | About PerfectXML | Advertise ©2004 All rights reserved. | Privacy