Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XSLT process empty file

Posted on 2013-10-28
3
Medium Priority
?
299 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 2000 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

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Make the most of your online learning experience.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

704 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