Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

C# transform and xml nodes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Praveen - 27 Jun 2007 11:42 GMT
Doing an xslt transform in C#.
Adding an object as below before transform.

ARG.AddExtensionObject("urn:MyCompany-Generic",Generic);

'Generic' is an instance of a class which contains various functions which
can be acceced in xsl by namespace.
Like <xsl:value-of select="namespace:MyFunction()"/>

looking for a  function which returns nodes from an xml string which can be
looped inside xsl for retrieving attribute values.

Transforming xml wil be like
'<R><A>&lt;R&gt;&lt;E V=&quot;1&quot;/&gt;&lt;E
V=&quot;2&quot;/&gt;&lt;/R&gt;</A></R>'

Here <A> contains another xml. I want to add a name space function to load
the xml and return nodes.

Hopes its clear.
thanks,
praveen
Praveen - 28 Jun 2007 12:07 GMT
> Doing an xslt transform in C#.
> Adding an object as below before transform.
[quoted text clipped - 18 lines]
> thanks,
> praveen

I got he solution.
For ref:

public XPathNodeIterator GetNodes(string xml,string xpath)

{

XmlDocument ToSndrXmlObj = new XmlDocument();
ToSndrXmlObj.LoadXml(xml);
XPathNavigator NavEmail = ToSndrXmlObj.CreateNavigator();
return ToSndrXmlObj.CreateNavigator().Select(xpath);

}

praveen

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.