Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:50:18+00:00 2026-06-09T21:50:18+00:00

Before I go into the specific details, I tried this before with Oracle’s parser.v2

  • 0

Before I go into the specific details, I tried this before with Oracle’s parser.v2 XSLT libraries and ran into the same problem (see my first question). However, it works fine when I use C#.

// from the example I see everywhere on the internet
SAXTransformerFactory stf = (SAXTransformerFactory)TransformerFactory.newInstance();

Templates t_cctagstrip = stf.newTemplates(new StreamSource(new FileInputStream("C:\\path\\to\\first.xsl")));
Templates t_cctable = stf.newTemplates(new StreamSource(new FileInputStream("C:\\path\\to\\second.xsl")));

TransformerHandler th1 = stf.newTransformerHandler(t_cctagstrip);
TransformerHandler th2 = stf.newTransformerHandler(t_cctable);

// transform 1 pipes into transform 2
th1.setResult(new SAXResult(th2));

// transform 2 pipes to System.out
th2.setResult(new StreamResult(System.out));

Transformer t = stf.newTransformer();
t.transform(new StreamSource(new FileInputStream("C:\\path\\to\\source.xml")), new SAXResult(th1));

I’m thinking that maybe the problem lies in the fact that the output from the first transform is a fragment with text at the root level?

text at root level
<tag> ... tags that need extra processing ... </tag>
more text at root level

Is there something different about how C# processes the transforms? It’s not failing or giving me any warnings that I can tell. It’s just not changing anything.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:50:19+00:00Added an answer on June 9, 2026 at 9:50 pm

    You didn’t in your first question mention the actual problems you’re running into, e.g., providing any log messages, etc. so it was impossible to know why your XSLT transformations are failing. But in this second question you clearly reveal why things are failing.

    In general, XSLT transformations require all parsed content to be at very least well-formed XML. If your source document isn’t wrapped with a “root” element (actually called a document element) then it’s not well-formed XML, therefore not by definition XML, and therefore not suitable for XML processing.

    As a solution, if you can wrap the output from the first transform in a document element you could then continue to parse it as XML. You could then strip it off later via a non-XML process.

    There won’t be any difference between Java or C# in this regard. If the output from the first transformation is not well-formed XML then C# shouldn’t be accepting it as XML. I can’t explain why it might be doing so — C#’s XML processor would be non-compliant if it accepted non-well-formed XML. I imagine the reason you’re not getting any output is that the transformation is simply failing due to the non-XML source. In order to find out what’s actually going on you might set an javax.xml.transform.ErrorListener on your Transformer, and in your ErrorListener dump everything to a log.

    (As a bit of a tangent, you also state you’re required to use Oracle’s XSL processor. Really? I’ll assume there must be some features in Oracle’s implementation that aren’t available in Xalan or Saxon, as you’d be tying your code to an implementation rather than using the JAXP API, which is certainly not recommended practice. It’s probably better to debug problems when coding to the API to be sure that they’re not implementation-dependent, since you aren’t able to change the internal code of an implementation and it’s better to only be debugging your own defects, not Oracle’s. But given your example code above seems to be using the JAXP API I’ll assume the problems you have aren’t actually tied to Oracle’s XSLProcessor.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
Wondering if anyone out there has ran into this before.... I'd like to use
before this I wrote all jquery-code into main fail. Now I want to move
This post rambles a bit so before I get into it I want to
I know this specific question has been asked before , but I am not
Before diving into Wordpress just wanted to see if it is possible to have
I did my programming before integrating into a design and I have to admit
I have a variable which I need to strip of sybols before inserting into
Before Entering data into a database, I just want to check that the database
Before I dive into the disscusion part a quick question; Is there a method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.