Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2007, 02:33 AM
Registered User
 
Join Date: Feb 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to harshalchoksi Send a message via Yahoo to harshalchoksi
Default Mulitple roots supports with LoadXML processing

i have one query like i want to process 5 xml to one xslt file & even i have XML as well for that.when i am using XMLdoc.LoadXml(Whole XML) it gives me an error "there are muliple root elements." i thing you had a same query but i need to know how did you solve that query.
here i have XML:

<PageOnlyResults>
      <Name>#2344;#2367;#2358;#2366;#2344;#2366; #2330;#2370;#2325; #2327;#2351;#2366;</Name>
      <Summary>#2344;#2367;#2358;#2366;#2344;#2366; #2330;#2370;#2325; #2327;#2351;#2366;</Summary>
      <MasterId>4700331c-7650-4192-aa17-a7f3243259c1&amp;632</MasterId>
 </PageOnlyResults>
 <DownLoadResults>
      <Name>Doc1</Name>
      <Summary>PDF WP_em ay te te ar es with b an an a</Summary>
      <FileSize>638189</FileSize>
      <UniqueId>3259</UniqueId>
 </DownLoadResults>
 <ContentResults>
      <Name>westminster</Name>
      <LongSummary>What we do</LongSummary>
      <ContentType>.htm</ContentType>
      <MasterId>1c36f23e-102f-4860-9c96-29a92ebd3b2c</MasterId>
      <NavigationId>526</NavigationId>
      <ParentName>What we do</ParentName>
      <UniqueId>0</UniqueId>
 </ContentResults>
 <AlternativeResults>
      <Path>NavigationId=519&amp;MasterId=7345e62b-abdf-47be-a30d-ecf7fdb80ffc&amp;SearchText=London</Path>
 </AlternativeResults>"


Harshal D. Choksi
 
Old March 2nd, 2007, 04:13 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>here i have XML:

No you don't. You have something that would be XML if you put a wrapper element around it. Without that wrapper element, it's not an XML document.

One way to add the wrapper element is to reference your file as an external entity from a skeleton document that adds the wrapper, like this:

<!DOCTYPE doc[
<!ENTITY e SYSTEM "original.xml">
]>
<doc>&e;</doc>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
AdRotater Control Supports Flash Files? Harjinder ASP.NET 2.0 Professional 1 March 22nd, 2008 05:47 AM
update mulitple rows in SQL 2K danastasio Classic ASP Databases 2 January 16th, 2007 12:14 PM
Mulitple fields primary key ksa266 Access VBA 1 December 15th, 2003 10:13 AM
Sorting on mulitple colums Greg Griffiths Javascript 0 June 20th, 2003 12:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.