* mahesh.nimbalkar@gmail.com wrote in microsoft.public.dotnet.xml:
>When I transform XML, XSLT automatically adds extra attributes to the
>node which are declared in DTD (default DTD attributes) . I just want
>XSLT not to add these extra default attributes from DTD.
Then you have to remove the document type declaration or otherwise
instruct your transformation engine and/or parser to not read the
external subset. There is no way to achieve this using only XSLT.

Signature
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
mahesh.nimbalkar@gmail.com - 27 Mar 2007 22:38 GMT
Thank you for the reply Bjoern Hoehrmann
I am using following VB.NET code for transformation. Please tell me
where I can set flag for not to resolve externals.
Sub Main(ByVal args() As String)
Dim xmlInputFile As String = args(0)
Dim xslInputFile As String = args(1)
Const xmlOutputFile As String = "output.xml"
Dim xPathDoc As New XPathDocument(xmlInputFile)
Dim transform As New XslCompiledTransform()
Dim results As Stream = Nothing
Try
results = File.Create(xmlOutputFile)
Dim argsList As New XsltArgumentList()
Dim dateAndTime As New MyDateTime()
argsList.AddExtensionObject("urn:MyDateTime", dateAndTime)
transform.Load(xslInputFile)
transform.Transform(xPathDoc, argsList, results)
Catch ex As Exception
results.Flush()
Console.WriteLine(ex)
Finally
results.Close()
End Try
End Sub
> * mahesh.nimbal...@gmail.com wrote in microsoft.public.dotnet.xml:
>
[quoted text clipped - 9 lines]
> Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·http://www.bjoernsworld.de
> 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·http://www.websitedev.de/
Helena Kotas [MSFT] - 30 Mar 2007 23:54 GMT
You can disable to DTD from loading if you set the XmlResolver to null. To do
so you will need to load the XPathDocument from a reader:
Dim reader As New XmlTextReader(xmlInputFile)
reader.XmlResolver = null
Dim xPathDoc As New XPathDocument(reader)
HTH,
Helena Kotas, MSFT
> Thank you for the reply Bjoern Hoehrmann
>
[quoted text clipped - 41 lines]
> > Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·http://www.bjoernsworld.de
> > 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·http://www.websitedev.de/
Peter Flynn - 27 Mar 2007 23:38 GMT
> * mahesh.nimbalkar@gmail.com wrote in microsoft.public.dotnet.xml:
>> When I transform XML, XSLT automatically adds extra attributes to the
[quoted text clipped - 4 lines]
> instruct your transformation engine and/or parser to not read the
> external subset. There is no way to achieve this using only XSLT.
Or change the DTD so that those attributes become optional instead of
compulsory.
///Peter

Signature
XML FAQ: http://xml.silmaril.ie/
mahesh.nimbalkar@gmail.com - 27 Mar 2007 23:43 GMT
I do not have control to that DTD. It is managed by one organization
for Book industry.
> > * mahesh.nimbal...@gmail.com wrote in microsoft.public.dotnet.xml:
> >> When I transform XML, XSLT automatically adds extra attributes to the
[quoted text clipped - 11 lines]
> --
> XML FAQ:http://xml.silmaril.ie/