BookmarkSubscribeRSS Feed
Peter_Y
Calcite | Level 5

Hello all:

   I am now reading the book "Implementing CDISC Using SAS" by Holland and Shostak to learn CDISC implementation. Chapter 2 showed an example of creating define.xml from excel spreadsheet in base SAS. The authors provided SAS code/output & stylesheet on the book site

https://support.sas.com/en/books/authors/chris-holland.html

 

The sample directory for chapter 2 includes define.xml and define2-0-0.xsl. However, the main output define.xml cannot be properly rendered. Microsoft edge and Chrome displayed an empty page. Firefox displayed contents in define.xml without the proper format. 

Peter_Y_0-1653612268723.png

Interestingly, it was properly shown in internet explorer, which retires soon. 

Peter_Y_1-1653612950798.png

So I suppose something in the define.xml is not supported by modern browser? Does anyone know what the problem is and how to fix it?

 

This makes me worry about learning CDISC implementation in SAS with this book. Are there any other good (and more recent) references/resources? 

 

Thanks,

Peter

8 REPLIES 8
ballardw
Super User

How about first showing the LOG of the code that  you submitted that created the output with all the notes and messages generated. Copy the text from the LOG and paste into a text box opened on the forum with the </>. That way we have a chance of knowing what you did.

 

XML not rendering in Excel can be a setting issue as I had to spend a moderate amount of time getting Excel to show XML as data after our "upgrade" to Office 365 as Excel did not want want to use XML files as data by default.

Ksharp
Super User
I got the same problem as yours . I think it is not problem from code of book, it is about browser Microsoft edge or Chrome themselves.

The best way to create define.xml is using the software  Pinnacle 21 . It is totall free or You can buy SAS software to generate define.xml
https://www.pinnacle21.com/downloads

And here is my data step code for define.xml
https://communities.sas.com/t5/SAS-Communities-Library/Create-Define-xml-file-by-data-step/ta-p/7204...
lexjansen
Obsidian | Level 7
It is not a problem with the XML. The fact that Chrome and Edge do not render the Define-XML file is because of security issues. No modern browser allows the rendition of XML by applying an XSL file within the browser. Internet Explorer was the only browser that still allowed it. But, as you mention, IE has long been abandoned by Microsoft, and soon will be end-of-life. You can use PROC XSL in SAS to create an HTML file from the XML and the stylesheet that can be opened by any browser. PROC XSL can be limited, so here is another solution to create HTML: https://swhume.github.io/blog-2022-generate-html-from-xml.html

kevinkk
Calcite | Level 5

"PROC XSL can be limited"

Could you explain some details about the limitations? What should we pay attention to if we want to use PROC XSL?

lexjansen
Obsidian | Level 7

One thing that I ran into is that PROC XSL does not work well, when your stylesheet imports other stylesheets. If I remember well, it had issues resolving relative paths that were used for including other stylesheets.

kevinkk
Calcite | Level 5

Hi Lex,
Thanks for your explanation and will note this in daily work; Currently our project would merely use the official released stylesheet and it workd well, likes below:

proc xsl
	in="&define_sdtm_root.define_SDTM.xml"
	xsl="&define_sdtm_root.define2-1-0.xsl"
	out="&define_sdtm_root.define_SDTM.html";
run;

I understand that in some cases, we may need to modify the stylesheet, but I'm not sure about the situation you mentioned, "stylesheet imports other stylesheets".

 

Are you referring including another stylesheet inside the current stylesheet? I don't quite understand why this is done. Could you introduce a bit about it, or are there any papers that introduce this work.

 

Thank you!

 

lexjansen
Obsidian | Level 7

When you want to create a modular design, it is quite common to import stylesheets (xsl:import). PROC XSL does not support that.

An extended example of this is how the SAS Clinical Standards Toolkit implemented transformations:

https://github.com/sassoftware/clinical-standards-toolkit/tree/main/standards/cstdefinexml21/source/...

 

kevinkk
Calcite | Level 5

Thank you Lex, it's truly enlightening, I will explore more details in this area.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 8 replies
  • 3697 views
  • 3 likes
  • 5 in conversation