Solved

XSLT process empty file

Posted on 2013-10-28
3
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Simple Linear Regression

636 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