formatting xml document dynamically

Hello All,
I have an asp.net search application that brings up a datagrid of results,
with one of the fields being a hyperlink to an XML document, of which there
are thousands. By clicking this link, the browser loads the XML document in
its raw form.
My question is, how do I use some of these formatting techniques (XSL etc)
to format this XML the way I want to, after the link is clicked on?

A  nudge in the right direction would be appreciated, as I can't seem to
find any example of what I am doing.

Thanks
Miki


0
zszinegh (2)
1/23/2004 1:27:17 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
595 Views

Similar Articles

[PageSpeed] 36

HI Miki,

You should be able to use the XslTransform class.
Below is an example

XslTransform xslt = new XslTransform();

//Load the stylesheet.
xslt.Load("http://server/YourXSLFileHere.xsl");

//Create a new XPathDocument and load the XML data to be transformed.
XPathDocument mydata = new XPathDocument("inputdata.xml");

//Create an XmlTextWriter which outputs to the console.
XmlWriter writer = new XmlTextWriter(<Output file or Response Stream Here>);

//Transform the data and send the output to the destination
xslt.Transform(mydata,null,writer, null);

Regards,

Bennie

"Miki Szinegh" <zszinegh@sympatico.ca> wrote in message
news:%23jTELAV4DHA.2332@TK2MSFTNGP10.phx.gbl...
> Hello All,
> I have an asp.net search application that brings up a datagrid of results,
> with one of the fields being a hyperlink to an XML document, of which
there
> are thousands. By clicking this link, the browser loads the XML document
in
> its raw form.
> My question is, how do I use some of these formatting techniques (XSL etc)
> to format this XML the way I want to, after the link is clicked on?
>
> A  nudge in the right direction would be appreciated, as I can't seem to
> find any example of what I am doing.
>
> Thanks
> Miki
>
>


0
haelenb (3)
1/23/2004 1:57:03 AM
Thanks Bennie, for the information. I guess I need to clarify some more what
I'm trying to do.
I need to somehow grab the file location from the Hyperlink that the user
clicks on and feed that to the XPathDocument. Bear in mind that the actual
filename of the XML document I need to format comes as a result of the user
selecting a particular file in my application.

Thanks again, I'm still trying to wrap my head around the XML/XSL etc stuff,
I have not used this before.

Miki


<haelenb@bellsouth.net> wrote in message
news:uoGt0QV4DHA.1636@TK2MSFTNGP12.phx.gbl...
> HI Miki,
>
> You should be able to use the XslTransform class.
> Below is an example
>
> XslTransform xslt = new XslTransform();
>
> //Load the stylesheet.
> xslt.Load("http://server/YourXSLFileHere.xsl");
>
> //Create a new XPathDocument and load the XML data to be transformed.
> XPathDocument mydata = new XPathDocument("inputdata.xml");
>
> //Create an XmlTextWriter which outputs to the console.
> XmlWriter writer = new XmlTextWriter(<Output file or Response Stream
Here>);
>
> //Transform the data and send the output to the destination
> xslt.Transform(mydata,null,writer, null);
>
> Regards,
>
> Bennie
>
> "Miki Szinegh" <zszinegh@sympatico.ca> wrote in message
> news:%23jTELAV4DHA.2332@TK2MSFTNGP10.phx.gbl...
> > Hello All,
> > I have an asp.net search application that brings up a datagrid of
results,
> > with one of the fields being a hyperlink to an XML document, of which
> there
> > are thousands. By clicking this link, the browser loads the XML document
> in
> > its raw form.
> > My question is, how do I use some of these formatting techniques (XSL
etc)
> > to format this XML the way I want to, after the link is clicked on?
> >
> > A  nudge in the right direction would be appreciated, as I can't seem to
> > find any example of what I am doing.
> >
> > Thanks
> > Miki
> >
> >
>
>


0
zszinegh (2)
1/23/2004 3:42:33 PM
Reply:

Similar Artilces:

conditional formatting #9
I understand that conditional formatting is used to create a specific format when a number matches a specified criteria. If I have a list of eight cells with numbers in them, can I highlight the highest and lowest number in the list with conditional formatting (both different colors) ** Posted via: http://www.ozgrid.com Excel Templates, Training, Add-ins & Software! http://www.ozgrid.com/Services/excel-software-categories.htm ** one way: CF1: Formula is =A1=MAX($A$1:$A$8) Format1: Red CF2: Formula is =A1=MIN($A$1:$A$8) Format2: Blue In article <410c6a91$0...

Format E-Mail address in Contact
Hi, I have a problem with the format of the email address in the contact form in Outlook 2000. I have imported some contacts from Outlook Express and I added some after the import. The imported contacts are showed as eg Mike Test and if I show the properties of Mike Test a full contact window apears (one like from the Windowsaddressbook). If however I open an added contact the email address apears like mike.test@domain.com. If I show the properties of this address I just get a small window with the SMTP adrdress. I want all addresses to have the SMTP format in the email field. Has anybody an ...

loading photo from publisher into jpeg format web page
hi all, first time here. i need help in loading a publisher photo (s) into my new web page (yahoo) that only accepts photos in the jpeg format it seems? would appreciate any help. thanks What format are you trying to use? Most if not all Publisher photos are .jpg. Bring the image into a paint program (MS Paint will suffice) and convert it to .jpg. www.irfanview.com is free and a wonderful little viewer that will convert the image. Get the plug-ins too, some formats need them. -- Mary Sauer MS MVP http://office.microsoft.com/ http://www.mvps.org/msauer/ news://msnews.microsoft.com "d...

Moving dynamic connector connection points
I am working with a database ERD created using the Visio "Database Model Diagram" template (2002 SR-1 v10.0.2514). I have a dynamic connector defining a foreign key relationship in my diagram. The dynamic connector attaches to both table objects on the bottom edge. I would like to have the dynamic connector attached to the top edge of both objects. I am looking for a way to relocate the connection point of a dynamic object to another edge of the same object it is currently connected to. Is there a way to do this? Thanks, Gary Faulkner ...

Yahoo Store Integration XML Tag for Item Comment
Hello, Does anyone know the XML tag to import an Item Cooment from a web order. These are the only tags I have seen. <Item num ="0"> <Id>9002</Id> <Code>9002</Code> <Quantity>1</Quantity> <Unit-Price>12.99</Unit-Price> <Description></Description> <Taxable>NO</Taxable> </Item> Thanks Jamie Item Comment is what I meant to say. Not Cooment. Sorry "Jamie W." wrote: > Hello, > Does anyone know the XML tag to import an Item Cooment from a web order. > These are the only tags I have ...

how do i insert a page from a read only pdf document into word
how do i insert a page from a read only pdf document into word without losing reading quality? Word has no ability to handle PDF format documents. The only solutions are to extract the content of the PDF using OCR software such as FineReader or OmniPage, or to insert the first page of the PDF file as an object. (Objects cannot cross page boundaries in Word). If you insert an object it will adapt to the active margins, and as an image this will result in some image impairment. The best you can achieve is to set the layout wrap option of the object to something other than in-line...

Tab seq dynamically...
I have a button which added dynamically to a property sheet. Now for setting the tab sequence with this new button, Am using SetWindowPos() method. Now tab sequence is proper. THE PROBLEM IS Through the arrow keys, I could not navigate to the last button for which I called SetWindowPos. where as through tab keys I could go to the last control. I will appreciate ur help in this. DETAILED DESCRIPTION I have three buttons (OK,Cancel, Help)on the property sheet. I added a button "Default" to the property sheet and positioned between Cancel and Help. I set the tab sequence as ...

Excel formatting #2
Could someone please help with a macro or any other suggestion to format an Excel sheet. Basically data is downloaded from a bank every week and the size of the file can vary but the formatting is constant. That is each record is 7 lines. So first record is line1-7, second record is line 8-14, third record is line 15-21 and so on. I need to format this data and basically I can record a macro for one data set that is for the record on line 1 to 7. My question is how can I set it to replicate so that it replciates for line 8-14 and then 15-21 and so on. The source formatting remains the same ex...

Help with dynamic ranges
Can anyone recommend a good book/site/resource for creating and troubleshooting dynamic ranges & using OFFSET()? I need to get more general understanding of how they work with examples. Mine seem to expand the range but don't carry over the formatting. Thanks, -- JoAnn > Mine seem to expand the range but don't carry over the formatting. Formulas* cannot carry over formats. They can only return values in the cells they are placed in. *any kind, inclusive OFFSET, dynamic ranges etc -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- Ok, thanks. -- JoA...

Date Format not working
I have a column of dates that are formatted like: 04/19/2009. BUT I want them formatted as: April, 2009 I cright click and try to format the date but nothing happens? Why? How can I change the format of these dates? I am using Excel 07 You'll have to change them from text to a date. Try Data/ Text to Columns/ and set the import format as MDY. -- David Biddulph "Stross002" <Stross002@discussions.microsoft.com> wrote in message news:A6BF4CE8-122F-47CC-A7B8-53ABA1F680FB@microsoft.com... > I have a column of dates that are formatted like: 04/19...

conditional format sum if
i would like to put in a conditional format for cell A3. in cells A1 and A2 i have dates and i want the formatting in A3 to come into effect if A2-A1 is greater than 9 days but i cannot get the right formula. many thanks if anyone can help. One way: CF1: Formula Is =(A2-A1)>9 In article <ae3801c436e9$164e3300$a401280a@phx.gbl>, "Micayla" <anonymous@discussions.microsoft.com> wrote: > i would like to put in a conditional format for cell A3. > in cells A1 and A2 i have dates and i want the formatting > in A3 to come into effect if A2-A1 is greater...

Smartlist's Account Trx should show document dates of submodules
Hi, When you use the Smartlist object Account Transactions and try to find the document date of those transactions coming from the sub modules - Smartlist will not be able to show it. There is a field Document Date, but it will show 00/00/0000. The created date is also not very useful as it takes the system/user date when the transaction was actually posted. Not all the time will the document date be equal to the transaction date. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click ...

conditional formatting deadlines
Hi - I have a worksheet with a column (m7:m40) containing dates of reviews that have taken place. I want to conditionally format it so that dates that are a year ago or more are highlighted. Any ideas? Many thanks hi Cell Value | is less than | =now()-365 >-----Original Message----- >Hi - I have a worksheet with a column (m7:m40) containing dates of reviews >that have taken place. I want to conditionally format it so that dates that >are a year ago or more are highlighted. Any ideas? Many thanks >. > ...

Beginner Question Re Excel Format
Hello, Using Excel 2007 and XP. New at this. Have Copied to the PC's Clipboard a page of data from a financial program. How do I setup Excel, before doing a Paste of this data, such that Excel "knows" that I want the data to appear in csv format in Excel ? Or, do I (or must I) just Paste it as an Excel Workbook format, and then do a Save-As in the csv format ? Thanks, Bob Have your tried a simple copy & paste? What happens? Do you know about the Data | Text to Columns feature? Can you get the other program to send data to a text file? Sorry to answer a question wi...

Formatting STOCK charts
Hi, Sorry i've tried this post before with no solution yet, but unfortunately i need to find one quite soon. I am using a STOCK type chart in excel with the table formatted in the required A B etc (up to 20 x-axis categories) Av Max Min Close way. In order to make the chart more ‘viewable’ I have changed the colours, sizes, bars etc as normal. However if I need to change the range of data using the source data option the chart reverts back to the default excel format of small bars, thin lines etc and I loose the items that I formatted. Can I stop...

XML to DataSet please help with selection
I have a two xml files schema is identical. When I read file into dataset and then bind dataset to the form. These are weather files we are getting from weather service. One file has only local weather so I don't have any problems with that, but other has weather for several different locations. Basically I need to select only weather for location if I know its code. I should have exactly same dataset so I will be able bind it to the same form without recoding. I was trying to use dataview, but dataview works only with one table and doesn't produce dataset. I got it working by ...

Unlocking a password locked word document
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have saved a document ages ago (in 2006) and password locked it. I am unable to open it now because I have forgotten what password I assigned. Is there any way to unlock it? It isn't so much a matter of 'when' you applied the pw as it is a matter of which version of the program was used. Different versions have employed somewhat different methods. Even so, the only thing you can do on your own is keep guessing... There is no "Disregard the Password" button :-) Depending on how critical...

publisher large format printing
I am trying to print an 8.5 X 11 calendar layout to 36 x 48 plotter. I can change the size, but a new calendar page comes up when I click ok. Is there a way to change the print paper size on an existing layout? It is much easier to let the large format rip handle resizing. Just make sure your smaller page is proportional. if you don't have a rip, well then you are not gaining all you could from the printer. In <60B895BE-512A-4220-BB15-23C47A4C1D35@microsoft.com> rwillsie wrote: > I am trying to print an 8.5 X 11 calendar layout to 36 x 48 plotter. > I can change the...

Formatting cells entered by a macro
I have a macro, that selects the last row in a range of cells and inputs a blank row just above this (as below). I want to then format the cells I input, and am having trouble writing the macro to select them Can anyone help? Dim LastRow As Long, NumberOfBlankRows NumberOfBlankRows = 1 LastRow = Range("A3:R1000").Find(What:="*", SearchOrder:=xlColumns, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row Intersect(Range("A:R"), Rows(LastRow)).Resize(NumberOfBlankRows).Insert You didn't tell us what kind of format you wan...

Create XML From access, Fill SQL 2000 Table
Are there .NET commands to create a new table from an XML Schema. I want to create a program which converts an access table to SQL 2000 using XML. Regards ...

ANN: CAX Caching Api for Xml
Beta version is available for CAX, a caching API for XML. CAX extends the functionality of the .NET XmlReader, which is a fast XML pull parser. CAX buffers and caches XML as it is parsed and provides a cursor to all previously parsed XML. CursorMoveToParent and CursorMoveToRoot are two of the eighteen cursor methods. The Path property gives the full path of the currently parsed node. CAX works with xml documents of unlimited size and uses very little memory. CAX may be downloaded from the company website: http://www.xponentsoftware.com/cax.aspx ...

Sorting an XML document.
I have a slightly different sorting question than has been proposed before. My docuement looks like: <Records> <Record> <Sequence>5</Sequence> <Name>E</Name> </Record> <Record> <Sequence>1</Sequence> <Name>A</Name> </Record> <Record> <Sequence>4</Sequence> <Name>D</Name> </Record> <Record> <Sequence>2</Sequence> <Name>B</Name> </Record> <Record> <Sequence>3</Sequence> &...

Dynamic graph turning static #2
I'm having trouble with a graph I'm trying to make dynamic. I made a named value "bottomright" that returns a reference to the bottom right cell of my data set. bottomright = OFFSET('Foo'!$B$2, COUNTA('Foo'!$A:$A)-2, 3, 1, 1). That much works nicely. The trouble I'm running into is in defining the data range for my graph. I set the data range to ='Foo'!$B$1:bottomright, and it makes a nice graph with exactly the data I want in it. When I add data, though, the graph doesn't update. I go back and check the data range, and it has switched my var...

format cell tabs hidden in excel dialog box
I saw a question posted earlier on this, but it did not fix my issue. We recently upgraded from Office 97 to Office 2003 and we're finding that some people in the company are experiencing the issues of some tabs in the format/cell dialog box being cut off from view. This is happening if you open an existing spreadsheet or a new one and is global to all users of the PC. I'm guessing it might be due to leftover remnants of Office 97 on these PCs and was wondering if there was a tool that searches out the files and removes them. If not, does anyone have any suggestions. The worst ...

use XmlReader/XmlWriter to reformat XML?
Since XmlWriter offers so many nice options for formatting, I thought it would be nice to read in via XmlReader, and write back out via XmlWriter. It might be overkill, but I'd also like to be able to check some values during that time also so I was going to be using XmlReader anyway. Unfortunately I don't see an easy way to stream it back out through XmlWriter without going node by node. Any suggestions? Is there an easier/faster way to do this already? Michael Michael Malinak wrote: > Since XmlWriter offers so many nice options for formatting, I thought it > would ...