Welcome to MSDN Blogs Sign in | Join | Help

Happy New Year Everyone! 

The new XML Schema Designer (see this previous blog post for a d/l location to the CTP) offers four views over XML Schema Sets: the XML Schema Explorer, Graph View, Content Model View, and Start View. The XML Schema Explorer shipped in VS 2008 SP1 and was blogged about previously here.  This entry will focus on the Content Model View (CMV).  The CMV offers a detailed look at a node’s compiled content model.

Basics of the view:

Q: What’s the purpose of the CMV?

A: To show a “compiled” content model view for an XSD node.  Basically it shows the node structure that is defined locally, shows structure included through extends/restricts for types, shows structure pulled in through refs, etc.  It then strips everything out of the content model that won’t show in the instance document for the node, e.g. a restricted attribute, allowing you to focus on what the schema will force XML docs to comply with. 

Q: How do you get to it?

A: You open an XSD in VS, drag a node onto the design surface and switch the designer to the CMV view.

Q: Can you view two node content models side by side (SxS)?  …and the XML Editor SxS as well?

A: Yes.  In the CTP all nodes are shown SxS.  In more recent builds, we’ve added a filmstrip that contains nodes that you’ve dragged into the designer.  For nodes in the filmstrip you select, a CMV is shown.  You can also tile an XML Editor instance with the designer and get support for SxS editing, viewing, etc.

The view is built with WPF and has nice zoom + pan capability.  We also show the properties of nodes using the Property Window.

 

Here are a few screenshots:

image

Content model view with filmstrip showing two CMVs SxS.

image

Deeply nested content model view and property window.

 

Shoot me an email at timlav@microsoft.com or post any comments & feedback you have here.

More on the Graph View next week….

Thanks!

- Tim Laverty

PM, Data Programmability XML Tools

The MSXML Team is pleased to announce that MSXML 4.0 Service Pack 3 (SP3) Beta is available for public testing. This new service pack includes a number of security bug fixes as well as reliability improvements.

MSXML4 SP3 is a complete replacement of previous service packs. The new service pack includes:

² A number of security bug fixes which provides a safer browsing experience.

² Reliability improvements.

MSXML 4 SP3  is a Download Center only release and is applicable to the following Windows Operation Systems:

· Windows 2000 SP4

· Windows XP SP2

· Windows XP SP3

· Windows Server 2003 SP1

· Windows Server 2003 SP2

· Windows Vista RTM

· Windows Vista SP1

· Windows 2008

We want to know what you think!  Please:

² Run your existing application against MSXML 4.0 Service Pack 3 (SP3) Beta to ensure the new service pack is compatible with your application with no behavior change.

² Send your feedback or file bugs to our product team through Microsoft Connect site. If you have not signed up yet, please do so - we are listed as "MSXML4 SP3 Beta" under the "Data Platform Development” site.

What you think is important for us. If you have any questions or comments or require any further information regarding the new service pack, please feel free to provide any feedback that you have.

-MSXML Team

The MSXML Team is getting ready to release the MSXML 4.0 Service Pack 3 Beta very soon!

MSXML4 SP3 is a complete replacement of previous MSXML 4.0 service packs. The new service pack includes:

- A number of security bug fixes

- Reliability improvements

The Beta will be available on Microsoft Download Center in the very near future.  The RTM release is scheduled in the next few months.

MSXML 4 SP3 is applicable to the following Windows Operation Systems:

•     Windows 2000 SP4

•     Windows XP SP2

•     Windows XP SP3

•     Windows Server 2003 SP1

•     Windows Server 2003 SP2

•     Windows Vista RTM

•     Windows Vista SP1

•     Windows 2008

What you think is important for us. If you have any questions or comments or require any further information regarding the new service pack, please feel free to reply on this blog.

 

- MSXML Team

In the Orcas SP1 release we released our XML Schema Explorer.  In the Visual tudio 10 PDC VPC we shipped our first rev of the next set of planned features for our XML Schema Designer.  Check out the Visual Studio 2010 and .NET Framework 4.0 CTP VPC here.  Over the next few weeks I’ll be posting in more detail about the features in the CTP.

- Tim Laverty

PM, Data Programmability XML Tools

Beth Massi and Yang Xiao did a great Channel 9 session that centered on XML Literals and the XML Schema Explorer. Check the session out here. One thing that doesn’t come across in the video is that the Explorer can be used with any XSD set, not just with XSDs associated w/ your VB project. See our previous blog posts here and here on the Schema Explorer for more detail. …and thanks to Beth & Yang for doing the video!

Tim Laverty

PM, Data Programmability XML Tools

This is the next post in our ongoing FAQ series. See the original post here.

Q2: Conformance Level – Fragment

There are times when you want to work with a piece of XML that is not a fully conformant xml document; an example of this is when the XML does not have one root element. This type of XML is called an XML fragment. Here is an example of an XML fragment:

“<foo></foo><bar></bar>”

If this snippet of XML is used as the source for to the XmlReader, the following exception will occur:

“There are multiple root elements. Line X, position Y.”

This is a good exception message and tells the user exactly what the problem is: more than one root element is not allowed in an XML document. But what happens if you really want to work with XML of this form? A flag in the XmlReaderSettings class is provided for exactly this situation: XmlReaderSettings.ConformanceLevel.

Code snippet to correctly read the XML fragment:

string xmlFragmentStr = "<foo></foo><bar></bar>";
//create a reader settings objects and set the conformance level to 
fragment
XmlReaderSettings xrs = new XmlReaderSettings(); xrs.ConformanceLevel = ConformanceLevel.Fragment; //create a reader using the reader settings XmlReader r = XmlReader.Create(new StringReader(xmlFragmentStr),
xrs); r.Read();

Shayne Burgess

Program Manager | Data Programmability

As part of a separate task, the XML team came up with a list of frequently encountered issues in System.XML; mainly points that we felt were interesting because they were the source of a lot of difficulty for our users. These questions ranged from rarely used (or misused) methods to difficult XML constructs.  We focused specifically on scenarios that were particularly difficult to debug. When we had completed the exercise, it occurred to the team that we should publish the list.

So what follows is the first in a multi-part series in which we will outline each of the questions we defined and provide an explanation of the correct usage, along with some sample code. However, our motives are not all selfless in this exercise; we are hoping to hear back from you in the comments section if there are any good questions we have missed. Let us know!

Q1: Invalid Literals

There are a number of reserved characters in XML that cannot be included as literals in an XML string – characters such as “&” and “<”. These characters must be escaped and the XML standard provides three methods for doing this: characters references (&#38), entity references (&amp;)  and CDATA sections.

This idea will seem like basic XML101 information for experienced XML users but it can be a difficult pain point for those new to XML. The problem is compounded because the error messages returned by the XML processor can be confusing. The error is also a simple one for a new user to stumble upon because the characters are often contained in regular text that may be used as the source for the XML data. The invalid literals are:

·           (&amp;)

·            (&lt;)

·         >    (&gt;)

·              (&apos;)

·             (&quot;)

Here is a sample list of incorrect literal strings, along with the correct usage and the exception message that is given for the incorrect usage. The messages all produce a line and position number which greatly assist the debugging process.

Character String

Correct Usage

Exception Message

A & B

A &amp; B

An error occurred while parsing EntityName. Line X, position Y.  

A &c B

A &amp;c B

' ' is an unexpected token. The expected token is ';'. Line X, position Y.

A &# B

A &amp;# B

Invalid syntax for a decimal numeric entity reference. Line X, position Y.

A < B

A &lt; B

Name cannot begin with the ' ' character, hexadecimal value 0x20. Line X, position Y.

Refer to section 2.4 of the XML Standard for more information on invalid literals.

Note: There will be a later post that deals with invalid XML characters in general and the correct way to deal with them.

Some future FAQ post topics include but are not limited to:

-          Conformance Levels

-          Reporting Validation Warnings

-          Correct Encodings

-          ProhibitDTD setting

-          XLinq Bridge Classes

 

Shayne Burgess

Program Manager | Data Programmability

 

3 Comments
Filed under:

We are looking for people that have a passion for creating rich, intuitive, integrated XML experiences and are able to drive innovation from vision to product.

 

If you’re passionate about cool experiences for world-class, innovative tools, interested in designing new cutting edge WPF visual designers and want to work for a team that’s focused on shipping technologies and having fun, we’re interested in hearing from you.  Drop us a line through the team blog or directly to me and we’ll get back to you.

 

Irinel Crivat

Program Manager| Data Programmability

 

irinelc@microsoft.com

The XmlPreloadedResolver is a new type that we’ve been working on in SilverLight that provides the ability to load a DTD without a call to the network. The new type can act as a manually maintainable cache of DTD’s and XML Streams.

Let’s look at two examples of how the XmlPreloadedResolver can be used.

Example 1:

The  XmlPreloadedResolver can be used to pre-load an external DTD. In the following example, a user-defined DTD is pre-loaded into the resolver. The resolver is then used when loading the XML file.

String strDtd = "<!ENTITY entity 'Replacement text'>";

String strXml = @"<!DOCTYPE doc SYSTEM 'myDtd.dtd'>

<doc>&entity;</doc>";

 

System.Xml.Resolvers.XmlPreloadedResolver resolver = new XmlPreloadedResolver();

            resolver.Add(resolver.ResolveUri(null, "myDtd.dtd"), strDtd);

 

            XmlReaderSettings rs = new XmlReaderSettings();

            rs.XmlResolver = resolver;

            rs.DtdProcessing = DtdProcessing.Parse;

 

XmlReader reader = XmlReader.Create(new StringReader(strXml), rs);

For the complete example, refer to:  http://msdn.microsoft.com/en-us/library/cc189063(VS.95).aspx

Example 2:

The XmlPreloadedResolver also contains two well-known DTD sets: XHTML 1.0 and RSS 0.91. These two well known DTD sets can be enabled via the XmlKnownDtd enumeration. The following is an example of using the XmlPreloadedResolver to preload the XHTML 1.0 DTD into an XmlReaderSettings object. In this example, no network calls are needed to parse an XHTML file.

XmlReaderSettings settings = new XmlReaderSettings();

            settings.DtdProcessing = DtdProcessing.Parse;

            settings.XmlResolver =

                new XmlPreloadedResolver(XmlKnownDtds.Xhtml10);

            XmlReader reader = XmlReader.Create("HTMLPage.html", settings);

            XDocument document = XDocument.Load(reader);

For the complete example, refer to: http://msdn.microsoft.com/en-us/library/cc189059(VS.95).aspx

Look for this new class in System.Xml.Resolvers namespace in a new DLL: System.Xml.Utils.dll that will be included as part of the upcoming SilverLight 2.0 SDK.

Shayne Burgess
Program Manager | Data Programmability

- and -

Helena Kotas
Senior Software Development Engineer | Data Programmability

6 Comments
Filed under: ,

A few months ago we added the XML Schema Explorer to the SP1 Beta release and are happy to announce that this week we've shipped with the .NET Framework 3.5 SP1 and Visual Studio 2008 SP1 RTM release.

As previously stated, the XML Schema Explorer illustrates our initial thinking about the future of XSD tools from Microsoft. Over the next few months we'll be communicating our additional tools plans for XSD, including when you'll be able to get your hands on upcoming bits.

Please send us your comments, questions, and suggestions via the XML and the .NET Framework forum on MSDN here.

Thanks,

Tim Laverty

Program Manager, XML Tools

 

Untitled

The Data Programmability XML Tools team is conducting a survey focused on XML technology and tools usage over the coming weeks.  The survey takes about 15 minutes to complete and we’d appreciate it if you would take the time to respond to it.  We plan to use the survey results to help drive prioritization of features over the coming releases of Visual Studio and SQL Server.

The survey can be found here:  https://mscuillume.smdisp.net/Collector/Survey.ashx?Name=XMLTools

Thanks, Tim Laverty

PM, XML Tools

We’re thrilled to announce that today the new XML Schema Explorer is included in the Orcas SP1 Beta release for Visual Studio 2008. We previously released a CTP showcasing a subset of the XML Schema Explorer functionality last August. Many of the people who downloaded and tried our August preview requested that we ship the functionality in Visual Studio 2008 and so we are. You can download the beta here.

The XML Schema Explorer illustrates our initial thinking about the future of XSD tools from Microsoft. Instead of working with strictly one XSD file in a text editor, the XML Schema Explorer allows you to view and work with an XML Schema Set, showing all XSDs imported and included in a hierarchal view.  The XML Schema Explorer offers tight integration with the XML Editor (allowing navigation seamlessly from Editor to XML Schema Explorer and back), the ability to search over the full schema set, the ability to show different views of a schema set (offering the ability to hide/show namespaces, files, as well as change schema set node ordering), the ability to general sample XML for global elements, and more. We are very much interested in gathering your feedback on the product, so please download the beta, give the feature set a try, and send us some feedback.

Over the next few weeks we’ll follow up with additional blog posts describing the functionality we’ve added in this release and discussing our future plans for adding to this start.

Please send us your comments, questions, and suggestions via the XML and the .NET Framework forum on MSDN here.

Thanks,

Tim Laverty

Program Manager, XML Tools

 

Untitled

Prior to SQL Server 2008, SQLXML 4.0 was released with SQL Server and was installed by all SQL Server editions, except in SQL Server Express. Beginning with SQL Server 2008, the latest version of SQLXML is no longer included in SQL Server.

 

When SQL Server 2008 is generally available, the latest version of SQLXML will be SQLXML 4.0 SP1.  The URL for the site where you can install SQLXML 4.0 SP1 will be added to this blog entry, and to the SQL Server 2008 Books Online, when SQLXML 4.0 SP1 is available.

 

If an application that requires SQLXML 4.0 will run on a computer where SQLXML 4.0 is not installed, you will need to download and install SQLXML 4.0 SP1.

 

SQLXML 4.0 SP1 Behavior with New Data Types Using SQLOLEDB and SQL Server Native Client OLE DB Provider

SQL Server 2008 introduces the following data types, which developers using SQLXML might want to use:

·         Date

·         Time

·         DateTime2

·         DateTimeOffset

When using SQLXML 4.0 SP1 with either SQLOLEDB (from Windows Data Access Components, formerly Microsoft Data Access Components) or SQL Server Native Client OLE DB from SQL Server 2005, these new types will appear as strings to a developer. SQLXML 4.0 SP1 will enable these four new data types as built-in scalara types when used with SQL Server Native Client OLE DB Provider 10.0 (SQLNCLI.10), which ships in SQL Server 2008. Until you download SQLXML 4.0 SP1, mapping these types to non-string types might cause truncation of some data. For example, mapping DateTime2 to xsd:date will cause data to be truncated to the SQL Server 2005 DateTime precision of 3.33 miliseconds.

 

David Schwartz

Programming Writer, Microsoft 

 

 

2 Comments
Filed under:

CoDe Magazine published an article on XML Tools.  It covers a wide range of topics:

  • Editing XML files,
  • Schema cache and catalogs,
  • Performance and working with large files,
  • XSLT debugging, and
  • Extending XML Tools

Enjoy!

Scott Hanselman talks about XML Tools in his new book "Professional ASP.NET 3.5: in C# and VB".  He mentions XML Editor, which is available in Visual Studio 2005 and 2008, as well as XML Schema Explorer, which we plan to ship in the next service pack.
More Posts Next page »
 
Page view tracker