Solved

XSLT process empty file

Posted on 2013-10-28
3
296 Views
Last Modified: 2013-10-29
Hello Experts,
Can we process empty file using XSLT..

I want to transform a empty file to this output below:

<DynamicValidationValueChanges dynamicValidationId="String" xsichemaLocation="_http://integration.cbre.com/schemas/gcs/intrepid/tsdynamicvalidation/v1 integration.cbre.com.schemas.gcs.intrepid.tsdynamicvalidation.v1.xsd" xmlns="_http://integration.cbre.com/schemas/gcs/intrepid/tsdynamicvalidation/v1" xmlns:xsi="_http://www.w3.org/2001/XMLSchema-instance"/>


Any Idea?

Thanks
0
Comment
Question by:mani_sai
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 39606831
well, why process an known to be empty file using XSLT?
Test the string content of the source, and when empty dump the expected result

Anyhow, XSLT requires a wellformed XML document as the source,
a wellformed XML documents has to the least exactly one root element
so an empty file can not serve as the source of an XSLT

Using XSLT2 you can indicate a starting template (has to be a named template)
but still you have to work around to cover both empty files and XML files,
so you are better off to deal with empty document logic outside the XSLT

I usually try to get the process generating the XML output at least an empty root element, so can easily cover teh required logic in pure XSLT terms
0
 
LVL 8

Author Comment

by:mani_sai
ID: 39608695
Thanks
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39608809
welcome
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
incorrect syntax near the order by 10 43
Designing forms 3 19
statistics basics sources 2 12
Assignment from incompatible pointer type? 2 13
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question