Spishixetters
New Member
Have an XSL file which contains starts with the following:\[code\]<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:XQHeaderFunc="java:com.sonicsw.xq.service.xform.HeaderExtension" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="XQHeaderFunc saxon"> <saxon:script language="java" implements-prefix="XQHeaderFunc" src="http://stackoverflow.com/questions/12462090/java:com.sonicsw.xq.service.xform.HeaderExtension" />\[/code\]And later in the file: \[code\]<xsl:variable name="processId" select="XQHeaderFunc:getProperty(XQHeaderFunc:new(),'processId',-1)" />\[/code\]When I try to do a transformation now I get this error:\[quote\] Cannot find a script or an extension object associated with namespace 'java:com.sonicsw.xq.service.xform.HeaderExtension'.\[/quote\]This is some SonicMQ specific stuff that I don't care about. Is there a way I can just ignore it somehow? I currently do the transformation like this:\[code\]var readerSettings = new XmlReaderSettings{ ConformanceLevel = ConformanceLevel.Document, IgnoreWhitespace = true, IgnoreComments = true, IgnoreProcessingInstructions = true, CheckCharacters = true,};var writerSettings = new XmlWriterSettings{ Encoding = Encoding.UTF8, ConformanceLevel = ConformanceLevel.Document, NewLineHandling = NewLineHandling.Replace, OmitXmlDeclaration = false, NewLineChars = "\r\n", Indent = true, IndentChars = " ", CloseOutput = false,};var xsl = new XslCompiledTransform(System.Diagnostics.Debugger.IsAttached);using (var stylesheet = XmlReader.Create(xslFile, readerSettings)) xsl.Load(stylesheet);using (var result = new MemoryStream()){ using (var xml = XmlReader.Create(xmlFile, readerSettings)) using (var xmlWriter = XmlWriter.Create(result, writerSettings)) { xsl.Transform(xml, xmlWriter); } // Deal with result}\[/code\]