Help setting up XSLT and XML files


i new ssis.  trying develop package create new xml file ("b") xml file ("a") , xslt file.  generated new xml file ("b") when examined contents of new xml file, see birthdate fields , other fields null.  wrong files?  have attached portions of relevant files below.

xml file "a":

 

<xml xmlns:s='uuid:bdc6e3f0-6da3-11d1-a2a3-00aa00c14882' 	xmlns:dt='uuid:c2f41010-65b3-11d1-a29f-00aa00c14882' 	xmlns:rs='urn:schemas-microsoft-com:rowset' 	xmlns:z='#rowsetschema'> <s:schema id='rowsetschema'> 	<s:elementtype name='row' content='eltonly'> 		<s:attributetype name='c0' rs:name='school-year' rs:number='1'> 			<s:datatype dt:type='int' dt:maxlength='4' rs:precision='10' rs:fixedlength='true' rs:maybenull='false'/> 		</s:attributetype> ... 		<s:attributetype name='c9' rs:name='birthdate' rs:number='10' rs:nullable='true' rs:write='true'> 			<s:datatype dt:type='date' dt:maxlength='6' rs:fixedlength='true'/> 		</s:attributetype> 		<s:attributetype name='c10' rs:name='gender' rs:number='11' rs:nullable='true' rs:write='true'> 			<s:datatype dt:type='string' rs:dbtype='str' dt:maxlength='2'/> 		</s:attributetype> 		<s:attributetype name='c11' rs:name='race_code' rs:number='12' rs:nullable='true'> 			<s:datatype dt:type='string' rs:dbtype='str' dt:maxlength='6'/> 		</s:attributetype> 		<s:attributetype name='c12' rs:name='district_code' rs:number='13' rs:nullable='true'> 			<s:datatype dt:ty pe='string' rs:dbtype='str' dt:maxlength='14'/> 		</s:attributetype> ... 		<s:extends type='rs:rowbase'/> 	</s:elementtype> </s:schema> <rs:data> 	<z:row c0='2004' c1='057' c2='0' c3='2010' c4='671590' c5='2010' c6='aanenson' c7='shelli' c8='a' birthdate='1992-07-01' 		 gender='f' c11='5' c12='' c13='false' c14='true' c15='false' c16='false' c17='false' c18='false' c19='false' 		 c20='i' c21='12' c22='7' alphakey='aanenshe000' c24='057' c25='624000671590' c26='011' advisor='0' c28='false' 		 c29='r' c30='' c31=''/> 	<z:row c0='2004' c1='057' c2='0' c3='2010' c4='671590' c5='2010' c6='aanenson' c7='shelli' c8='a' birthdate='1992-07-01' 		 gender='f' c11='5' c12='' c13='false' c14='true' c15='false' c16='false' c17='false' c18='false' c19='false' 		 c20='i' c21='12' c22='7' alphakey='aanenshe000' c24='057' c25='624000671590' c26='011' advisor='0' c28='false' 		 c29='r' c30='' c31=''/> 	<z:row c0='2004' c1='057' c2='0' c3='2010' c4='671590' c5='2010' c6='aanenson' c7='shelli' c8='a' birthdate='1992-07-01' 		 gender='f' c11='5' c12='' c13='false' c14='true' c15='false' c16='false' c17='false' c18='false' c19='false' 		 c20='i' c21='12' c22='7' alphakey='aanenshe000' c24='057' c25='624000671590' c26='011' advisor='0' c28='false' 		 c29='r' c30='' c31=''/>
...

 

and xslt file:

 

<?xml version='1.0' ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns="http://www.w3.org/1999/xhtml"    xmlns:s='uuid:bdc6e3f0-6da3-11d1-a2a3-00aa00c14882'  xmlns:dt='uuid:c2f41010-65b3-11d1-a29f-00aa00c14882'  xmlns:rs='urn:schemas-microsoft-com:rowset'  xmlns:z='#rowsetschema'>   <s:schema id='rowsetschema'>  <s:elementtype name='row' content='eltonly'>   <s:attributetype name='c0' rs:name='school_year' rs:number='1' rs:nullable='true'>  <s:datatype dt:type='int' dt:maxlength='4' rs:precision='10' rs:fixedlength='true' rs:nullable='true'/> ... <s:attributetype name='c9' rs:name='birthdate' rs:number='1' rs:nullable='true'>  <s:datatype dt:type='date' rs:dbtype='date' />  </s:attributetype>  <s:attributetype name='c10' rs:name='gender' rs:number='2' rs:nullable='true'>  <s:datatype dt:type='string' rs:dbtype='str' dt:maxlength='2'/>  </s:attributetype>  <s:attributetype name='c11' rs:name='race_code' rs:number='3' rs:nullable='true'>  <s:datatype dt:type='string' rs:dbtype='str' dt:maxlength='10' />  </s:attributetype>  <s:attributetype name='c12' rs:name='district_code' rs:number='4' rs:nullable='true'>  <s:datatype dt:type='string' rs:dbtype='str' dt:maxlength='20'/> ...  <xsl:attribute name="birthdate">   <xsl:value-of select="@c9"/>   </xsl:attribute>   <xsl:attribute name="gender">   <xsl:value-of select="@c10"/>   </xsl:attribute>   <xsl:attribute name="race_code">   <xsl:value-of select="@c11"/>   </xsl:attribute>   <xsl:attribute name="district_code">   <xsl:value-of select="@c12"/>   </xsl:attribute> ...

 

but resulting xml file ("b") looks like:

 

<?xml version="1.0" encoding="utf-8"?> <rows xmlns="http://www.w3.org/1999/xhtml">  <row school_year="2004" entity_id="057" term_nbr="0" schd_hst_grad_year="2010" other_id="671590" grad_yr="2010" last_name="aanenson" first_name="shelli" middle_name="a" birthdate="" gender="" race_code="5" district_code="" x_special_education="false" x_gifted_talented="true" x_section_504="false" x_migrant="false" x_iep="false" x_iep_accom="false" x_esl="false" student_status="i" student_id="12" eng_prof="7" alphakey="" school_id="057" mn_ede_nbr="624000671590" language_code="011" advisor="" mn_limited_english="false" type_student_id="r" cy_team_schd_id="" homeroom_number="">  </row>  <row school_year="2004" entity_id="057" term_nbr="0" schd_hst_grad_year="2010" other_id="671590" grad_yr="2010" last_name="aanenson" first_name="shelli" middle_name="a" birthdate="" gender="" race_code="5" district_code="" x_special_education="false" x_gifted_talented="true" x_section_504="false" x_migrant="false" x_iep="false" x_iep_accom="false" x_esl="false" student_status="i" student_id="12" eng_prof="7" alphakey="" school_id="057" mn_ede_nbr="624000671590" language_code="011" advisor="" mn_limited_english="false" type_student_id="r" cy_team_schd_id="" homeroom_number="">  </row>  <row school_year="2004" entity_id="057" term_nbr="0" schd_hst_grad_year="2010" other_id="671590" grad_yr="2010" last_name="aanenson" first_name="shelli" middle_name="a" birthdate="" gender="" race_code="5" district_code="" x_special_education="false" x_gifted_talented="true" x_section_504="false" x_migrant="false" x_iep="false" x_iep_accom="false" x_esl="false" student_status="i" student_id="12" eng_prof="7" alphakey="" school_id="057" mn_ede_nbr="624000671590" language_code="011" advisor="" mn_limited_english="false" type_student_id="r" cy_team_schd_id="" homeroom_number="">  </row>  <row school_year="2004" entity_id="057" term_nbr="0" schd_hst_grad_year="2010" other_id="671590" grad_yr="2010" last_name="aanenson" first_name="shelli" middle_name="a" birthdate="" gender="" race_code="5" district_code="" x_special_education="false" x_gifted_talented="true" x_section_504="false" x_migrant="false" x_iep="false" x_iep_accom="false" x_esl="false" student_status="i" student_id="12" eng_prof="7" alphakey="" school_id="057" mn_ede_nbr="624000671590" language_code="011" advisor="" mn_limited_english="false" type_student_id="r" cy_team_schd_id="" homeroom_number="">  </row> ...
can see although birthdate not null field value, appearing nulls in second xml file.  cause this?

 

where in xml data (from sample above) do see "c9"?

<z:row c0='2004' c1='057' c2='0' c3='2010' c4='671590' c5='2010' c6='aanenson' c7='shelli' c8='a' birthdate='1992-07-01'
gender='f' c11='5' c12='' c13='false' c14='true' c15='false' c16='false' c17='false' c18='false' c19='false'
c20='i' c21='12' c22='7' alphakey='aanenshe000' c24='057' c25='624000671590' c26='011' advisor='0' c28='false'
c29='r' c30='' c31=''/>

that's why i'm suggesting need looking different column.


john welch | www.varigence.com | www.agilebi.com | ssisunit.codeplex.com


SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........