From: Nick S. <nsi...@nu...> - 2022-08-16 02:53:23
|
I have wrote a Typeswitch function in which I want to remove an XML tag if it is present. My typeswitch function looks something like this: for $node in $nodes return typeswitch ($node) (:Ignore text and comments:) case text() return $node case comment() return $node case element(ExcludedDistributionChannel) return () default return my-typeswitch-transform:dispatch-recurse($node) My input looks something like this: let $input := <DealTerms> <TerritoryCode>AD</TerritoryCode> * <ExcludedDistributionChannel>** ** <PartyName>** ** <FullName>Adaptr</FullName>** ** </PartyName>** ** </ExcludedDistributionChannel>* <PriceInformation> <PriceRangeType>Budget</PriceRangeType> </PriceInformation> <ValidityPeriod> <StartDateTime>2022-12-01T02:35:00Z</StartDateTime> </ValidityPeriod> </DealTerms> When I look at my output, I get this: let $output := <DealTerms> <TerritoryCode>AD</TerritoryCode> <PriceInformation> <PriceRangeType>Budget</PriceRangeType> </PriceInformation> <ValidityPeriod> <StartDateTime>2022-12-01T02:35:00Z</StartDateTime> </ValidityPeriod> </DealTerms> Is there anything I can do to remove the new line character from the output, which the typeswitch function seems to add? I know that this white space is inconsequential to the processing of this document but if I could remove it, I would like to. Nick -- Nick Sincaglia President/Founder NueMeta, LLC Digital Media & Technology Phone: +1-630-303-7035 nsi...@nu... http://www.nuemeta.com Skype: nsincaglia |