XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 17 May 2012 12:51 AM
I'm attaching a stylesheet and file that works within a .net application. Yet when I run it in stylus studio I get an error indicating that it cannot find a matching 3 argument function named urn:GAASI-stuff)etEntityURI()

I need this function becasue the unparsed-enityt-uri xslt function is not supported by MS - otherwise I would be using that.


UnknownDescriptive_GA.xsl
stylesheet

UnknownDMC-S1000DBIKE-AAA-D00-00-00-00AA-041A-A_005-00.xml
xml file

Postnext
Ivan PedruzziSubject: Bug when calling a ms script function
Author: Ivan Pedruzzi
Date: 17 May 2012 09:39 AM

Open the scenario dialog go to Processor tab and switch to the .NET XslCompiledTranform processor and un-check the Stylus Studio URI Resolver

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 17 May 2012 11:33 PM
Ok, I don't get the error any more but I also don't get any output. All I get is a message about

WRN: Assembly binding logging is turned OFF.

Postnext
Ivan PedruzziSubject: Bug when calling a ms script function
Author: Ivan Pedruzzi
Date: 18 May 2012 10:38 AM

Could you upload the missing files?

SystemXML\CDContent.xml
Transform\Cover.xml


Ivan Pedruzzi
Stylus Studio Team

Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 19 May 2012 01:46 PM
here you go


UnknownCover.xml


UnknownCDContent.xml


UnknownCDContent(1).xml

Postnext
Ivan PedruzziSubject: Bug when calling a ms script function
Author: Ivan Pedruzzi
Date: 22 May 2012 12:50 PM
We could not replicate the error you have mentioned but either could not run the transformation.

This extension function assumes that the XPathNavigator underline implementation is XmlDocument which is not always the case, and blindly cast to IHasXmlNode ((System.Xml.IHasXmlNode)node.Current)

The following implementation is not efficient but performs the same task creating an XmlDocument on the fly.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

<ms:script implements-prefix="user" xmlns:ms="urn:schemas-microsoft-com:xslt" language="C#">
<![CDATA[

public string getEntityURI(System.Xml.XPath.XPathNodeIterator node, string entityName, string rootPath)
{
if (node == null ) {
return "NODE IS NULL";
}

if (node.MoveNext()) {

XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
XmlReader reader = XmlReader.Create(node.Current.BaseURI, settings);
XmlDocument document = new XmlDocument();
document.Load(reader);

XmlEntity entity = (XmlEntity)document.DocumentType.Entities.GetNamedItem(entityName);
if (entity == null ) {
return "ENTITY NOT FOUND: " + entityName;
}
return rootPath + "\\Files\\" + entity.SystemId;
}
return "MOVE NEXT FAILED";
}
]]>
</ms:script>

Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 23 May 2012 12:55 AM
Thanks for the revised code. So what mode is this supposed to be run in? If I go back to the saxon parser I get the same error about not finding a argument function. When I switch back to the .NET XslCompiledTransform I get the same warning and no output.

Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 23 May 2012 01:03 AM
When I switch to the .Net XslTransform (not the compiled version) I do get some output. In the case of your updated code, I'm not finding the images when running in StylusStudio but the code does execute properly within the application.

Postnext
Ivan PedruzziSubject: Bug when calling a ms script function
Author: Ivan Pedruzzi
Date: 23 May 2012 08:17 AM
Hi Dan,

Your transformation works only with Microsoft .NET based XSLT processors (XslTranform and XslCompiledTransform) because relies on a C# extension function.

Which Stylus Studio version are you running?
Which Windows version are you running?
Which .NET Framework is installed in your system?


Could you post a screenshot of the entire Stylus Studio main window (make sure that the preview window and the output window are fully visible) when the warning comes up?

If the images have relative paths you may need to set the Base URL in the scenario dialog which will be prefixed to all relative paths.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 23 May 2012 11:32 PM
so I'm using x14 Enterprise, Windows XPPro, I have .NET Framework 1.1, 2.0 SP 2, 3.0 SP 2, 3.5 SP 1, 4 Client profile and 4 extended.

So the error message results when I use the .NET compiled and when I use the other .NET I get no error, and I get output but no images. The code should be passing in the rootpath that is concatenated to the rest of the file info.


DocumentDoc1.docx

Postnext
Ivan PedruzziSubject: Bug when calling a ms script function
Author: Ivan Pedruzzi
Date: 24 May 2012 08:13 AM

Have you un-check the Stylus Studio URI Resolver in the scenario dialog (see screenshot attached) as we suggested in the first message?

In the resulting HTML we can see paths like this, this does seem a correct URL, the root is missing and there are Backslashes

\Files\ICN-S1000DBIKE-AAA-D000000-0-U8025-00536-A-04-1.CGM


Ivan Pedruzzi
Stylus Studio Team

Postnext
Dan VintSubject: Bug when calling a ms script function
Author: Dan Vint
Date: 25 May 2012 12:07 PM
That only affects the Compiled version. When I go back to the .NET Compiled and uncheck it, I start to get some content displayed but then the error occurs and stops the output

-------------------
External XSLT processing started...
System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\Documents and Settings\dvint\Desktop\IETP bike 3.0\Files\Transform\Cover.xml'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.Xsl.Runtime.XmlQueryContext.GetDataSource(String uriRelative, String uriBase)
...done
-----------------
Based upon the path it reports as a problem, it looks like this mode is changing the way things are read. It is now expecting the cover.xml file to be within the files folder (where the stylesheet lives). This is functioning in this processor different from the others.

So for my application, it looks like the .NET Compiled is functioning differently.

..dan

Posttop
Ivan PedruzziSubject: Bug when calling a ms script function
Author: Ivan Pedruzzi
Date: 25 May 2012 02:25 PM

One issue at the time.

Your style-sheet makes use of a global parameter called "paramPath" to adjust the URL to correct location. Your application binds the parameter to appropriate path *before* running the style-sheet.

Stylus Studio allows to simulate the same behavior, go to the scenario dialog, Parameter Values tab and set the appropriate value there, see screenshot attached.

Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.