The StylusFile Object

In Java, we write the following to retrieve the content of a file, myfile.txt, that resides on an FTP server:

java.net.URL myUrl = new java.net.URL("ftp://myserver/myfile.txt");
               
java.io.InputStream inputstream = myUrl.openStream();
               

            

The content of myfile.txt is placed in an instance of java.net.URL called myUrl.

The StylusFile object in the Stylus Studio File System Java API is similar to java.net.URL. In Stylus Studio, you use the createStylusFile() method in the StylusFileFactory class to create an instance of a StylusFile object, the contents of which is specified by an adapter URL. Consider the following simple Java application, which uses the URL composed by Stylus Studio that was introduced in Adapter URLs.

StylusFile myStylusFile = 
StylusFileFactory.getFactory().createStylusFile("adapter:CSV:newline=crlf:
sep=,:first=yes:escape=/:quotes='\"?file:///c:/Program Files/Stylus Studio 
XML Professional Edition/examples/Adapters/three.txt");
               
 
               
java.io.InputStream inputstream = myStylusFile.getInputStream();
               

            

In this example, the InputStream object holds the conversion result supplied by the adapter URL (that is, the conversion of three.txt using the CSV adapter).

See Example - demo.bat for a description of the sample Java application installed with Stylus Studio, which illustrates different uses of the adapter URL.

The XML Primer: Editing and Validating XML in Stylus Studio

The XML primer demonstrates editing and validating XML in Stylus Studio demonstrates XML editing tools and utilities to simplify working with XML documents. Learn how to automate XML editing operations and troubleshoot XML documents today!

Using the Stylus Studio XML Grid View

This free onlince video tutorial shows how to use the Stylus Studio XML Grid View.

XHTML Tools

Powerful XHTML Tools for converting HTML to XHTML, validating XHTML, transforming XML to XHTML, editing JSP, creating XML driven Websites and more.

XSL-List

The XSL-List forum is a valuable learning resource for the Extensible Stylesheet Language (XSL), covering the XSL specification, XSL processor implementations, and XSL user questions. Get this free XSL resource delivered to your inbox today.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member