Pazza
Wed Nov 16 08:48:17 CST 2005
Kevin,
I want to create an XML document from my object. This XML document will then
form the input into another application and at the same time be viewable via
IE using the stylesheet.
Pazza.
"Kevin Spencer" wrote:
> I can give it another shot. First, if you serialize a class, the class name
> element is going to be the root element of the serialized class. Now, you
> can certainly create an XML file from the class, but if you want the
> stylesheet to appear before the class element, it can not be a member of the
> class, but would have to be inserted into the XML file. What exactly is the
> requirement you are trying to fulfill here? Because if serializing a class
> is the requirement, you're barking up the wrong tree. But if creating an XML
> document from a serialized class is your goal, that is certainly doable. The
> XML document will not *be* the serialized class, but may *contain* the
> serialized class.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> If you push something hard enough,
> it will fall over.
> - Fudd's First Law of Opposition
>
> "Pazza" <Pazza@discussions.microsoft.com> wrote in message
> news:2D8C553C-016D-4795-8A01-18406D9B45FA@microsoft.com...
> > Help!!, is there anyone out there who can help with this please.
> >
> > "Pazza" wrote:
> >
> >> Kevin,
> >>
> >> Thanks for your reply.
> >>
> >> I created a schema and generated the class using xsd.exe.
> >> I then created an instance of the class and serialized it out to a file.
> >> The result was the following:
> >>
> >> <?xml version="1.0" encoding="utf-8"?>
> >> <className xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
> >> xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
> >> <stylesheet type="text/xsl" href="stylesheets/abc.xsl" />
> >> <Header>
> >> etc
> >> etc
> >>
> >> I have two problems with this ...
> >> (1) The <stylesheet> element is not formed properly ie. it is missing the
> >> ?
> >> from the start and end. And
> >> (2) I want the <stylesheet> element to appear before the root elment
> >> <className>.
> >>
> >> Can you offer any advice on how to correct (1) and how to achive (2)
> >> please?
> >>
> >> Pazza
> >> "Kevin Spencer" wrote:
> >>
> >> > If you serialize a class, only class members will be serialized. As an
> >> > XSL
> >> > stylesheet is a string, you have the option of creating a member of the
> >> > class (which represents the stylesheet) that can be serialized with it.
> >> > Otherswise, use an external stylesheet.
> >> >
> >> > --
> >> > HTH,
> >> >
> >> > Kevin Spencer
> >> > Microsoft MVP
> >> > ..Net Developer
> >> > Complex things are made up of
> >> > Lots of simple things.
> >> >
> >> > "Pazza" <Pazza@discussions.microsoft.com> wrote in message
> >> > news:CED9C30E-5967-4F70-8B30-3E632E649F60@microsoft.com...
> >> > > Hi,
> >> > >
> >> > > I need to be able to serialize my class such that the XML file
> >> > > contains a
> >> > > stylesheet directive after the XML definition as below:
> >> > >
> >> > > <?xml version="1.0" ?>
> >> > > <xml-stylesheet type="test/xsl" href="abc.xsl"?>
> >> > > <root>
> >> > > etc
> >> > > etc
> >> > >
> >> > > Can anyone tell me how to do this please?
> >> > >
> >> > > Pazza.
> >> >
> >> >
> >> >
>
>
>