Quantcast

Setting up a fixed field value when importing xml records

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Setting up a fixed field value when importing xml records

Xavier Berdaguer

Hello,

 

When importing some xml records, I am trying to set the value of the recordtype field to a fixed text.

 

Theoretically, this should be as simple as setting a parameter in the xsl file with the desired value:

 

<xsl:param name="rectype">vuxml</xsl:param>

 

Then, in the for-each record loop, I add the following expression:

 

<field name="recordtype">

                <xsl:value-of select="$rectype" />

</field>

 

I have seen in the example xsl file vudl.xsl that this is done with the collection and institution fields.

 

Surprisingly, the recordtype field is ignored when the records are imported (no error messages). The recordtype field is simply missing – it has no value, it  has not been imported. It seems the field value can only be inserted by adding the field at each single xml record imported.

 

Please could you tell me what is going wrong and what can be done about it?

 

Best regards,

 

Xavier

 


------------------------------------------------------------------------------

_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting up a fixed field value when importing xml records

Demian Katz

I agree that your approach sounds like it should work.

 

If you use the --test-only option of the import-xsl.php script, do you see your recordtype field in the resulting XML? This is a good way to troubleshoot XSL code without having to involve Solr.

 

If you’re still stuck, could you share with us your XSL and properties files and a sample XML record so we can try to reproduce the problem?

 

thanks,

Demian

 

From: Xavier Berdaguer [mailto:[hidden email]]
Sent: Thursday, December 01, 2016 9:39 AM
To: [hidden email]
Subject: [VuFind-General] Setting up a fixed field value when importing xml records

 

Hello,

 

When importing some xml records, I am trying to set the value of the recordtype field to a fixed text.

 

Theoretically, this should be as simple as setting a parameter in the xsl file with the desired value:

 

<xsl:param name="rectype">vuxml</xsl:param>

 

Then, in the for-each record loop, I add the following expression:

 

<field name="recordtype">

                <xsl:value-of select="$rectype" />

</field>

 

I have seen in the example xsl file vudl.xsl that this is done with the collection and institution fields.

 

Surprisingly, the recordtype field is ignored when the records are imported (no error messages). The recordtype field is simply missing – it has no value, it  has not been imported. It seems the field value can only be inserted by adding the field at each single xml record imported.

 

Please could you tell me what is going wrong and what can be done about it?

 

Best regards,

 

Xavier

 


------------------------------------------------------------------------------

_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting up a fixed field value when importing xml records

Andrew Krause
In reply to this post by Xavier Berdaguer

Hi Xavier,

 

I would try:

 

<xsl:variable name="rectype" select="'vuxml'" />

 

Andrew

 

From: Xavier Berdaguer [mailto:[hidden email]]
Sent: Thursday, December 01, 2016 8:39 AM
To: [hidden email]
Subject: [VuFind-General] Setting up a fixed field value when importing xml records

 

Hello,

 

When importing some xml records, I am trying to set the value of the recordtype field to a fixed text.

 

Theoretically, this should be as simple as setting a parameter in the xsl file with the desired value:

 

<xsl:param name="rectype">vuxml</xsl:param>

 

Then, in the for-each record loop, I add the following expression:

 

<field name="recordtype">

                <xsl:value-of select="$rectype" />

</field>

 

I have seen in the example xsl file vudl.xsl that this is done with the collection and institution fields.

 

Surprisingly, the recordtype field is ignored when the records are imported (no error messages). The recordtype field is simply missing – it has no value, it  has not been imported. It seems the field value can only be inserted by adding the field at each single xml record imported.

 

Please could you tell me what is going wrong and what can be done about it?

 

Best regards,

 

Xavier

 


------------------------------------------------------------------------------

_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting up a fixed field value when importing xml records

Library

Thanks for the suggestion, but I already tried with the xsl:variable statement with the same (unsuccessful) result.

 

From: Andrew Krause [mailto:[hidden email]]
Sent: 01 December 2016 16:34
To: Xavier Berdaguer
Cc: [hidden email]
Subject: Re: [VuFind-General] Setting up a fixed field value when importing xml records

 

Hi Xavier,

 

I would try:

 

<xsl:variable name="rectype" select="'vuxml'" />

 

Andrew

 

From: Xavier Berdaguer [[hidden email]]
Sent: Thursday, December 01, 2016 8:39 AM
To: [hidden email]
Subject: [VuFind-General] Setting up a fixed field value when importing xml records

 

Hello,

 

When importing some xml records, I am trying to set the value of the recordtype field to a fixed text.

 

Theoretically, this should be as simple as setting a parameter in the xsl file with the desired value:

 

<xsl:param name="rectype">vuxml</xsl:param>

 

Then, in the for-each record loop, I add the following expression:

 

<field name="recordtype">

                <xsl:value-of select="$rectype" />

</field>

 

I have seen in the example xsl file vudl.xsl that this is done with the collection and institution fields.

 

Surprisingly, the recordtype field is ignored when the records are imported (no error messages). The recordtype field is simply missing – it has no value, it  has not been imported. It seems the field value can only be inserted by adding the field at each single xml record imported.

 

Please could you tell me what is going wrong and what can be done about it?

 

Best regards,

 

Xavier

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting up a fixed field value when importing xml records

Gonzalo Faramiñan
Hi Xavier,

did you try setting the value directly into the template section? You can see it in the ojs.xsl example:

<!-- RECORDTYPE -->
<field name="recordtype">vuxml</field>

You won't be able to set it up through the properties file, of course.

Gonzalo


2016-12-02 5:13 GMT-03:00 Library <[hidden email]>:

Thanks for the suggestion, but I already tried with the xsl:variable statement with the same (unsuccessful) result.

 

From: Andrew Krause [mailto:[hidden email]]
Sent: 01 December 2016 16:34
To: Xavier Berdaguer
Cc: [hidden email]
Subject: Re: [VuFind-General] Setting up a fixed field value when importing xml records

 

Hi Xavier,

 

I would try:

 

<xsl:variable name="rectype" select="'vuxml'" />

 

Andrew

 

From: Xavier Berdaguer [[hidden email]]
Sent: Thursday, December 01, 2016 8:39 AM
To: [hidden email]
Subject: [VuFind-General] Setting up a fixed field value when importing xml records

 

Hello,

 

When importing some xml records, I am trying to set the value of the recordtype field to a fixed text.

 

Theoretically, this should be as simple as setting a parameter in the xsl file with the desired value:

 

<xsl:param name="rectype">vuxml</xsl:param>

 

Then, in the for-each record loop, I add the following expression:

 

<field name="recordtype">

                <xsl:value-of select="$rectype" />

</field>

 

I have seen in the example xsl file vudl.xsl that this is done with the collection and institution fields.

 

Surprisingly, the recordtype field is ignored when the records are imported (no error messages). The recordtype field is simply missing – it has no value, it  has not been imported. It seems the field value can only be inserted by adding the field at each single xml record imported.

 

Please could you tell me what is going wrong and what can be done about it?

 

Best regards,

 

Xavier

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Loading...