File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ foreign import numberValue :: XPathResult -> Effect Number
8686
8787foreign import stringValue :: XPathResult -> Effect String
8888
89+ -- | Not to be confused with retrieving xs:boolean values,
90+ -- | this is to be used with the XPath boolean() function call.
8991foreign import booleanValue :: XPathResult -> Effect Boolean
9092
9193foreign import singleNodeValueInternal :: XPathResult -> Effect (Nullable Node )
Original file line number Diff line number Diff line change @@ -195,5 +195,33 @@ main = runTest do
195195 Assert .equal RT .string_type (XP .resultType metajeloIdRes)
196196 Assert .equal " OjlTjf" metajeloId
197197
198+ prod0pol0xpath <- pure $
199+ " /x:record/x:supplementaryProducts/x:supplementaryProduct[1]" <>
200+ " /x:location/x:institutionPolicies/x:institutionPolicy[1]"
201+
202+ mjProd0Pol0Res <- liftEffect $ XP .evaluate
203+ (prod0pol0xpath <> " /x:refPolicy" )
204+ metajelo
205+ (Just mjNSresolver)
206+ RT .string_type
207+ Nothing
208+ metajeloDoc
209+ mjProd0Pol0 <- liftEffect $ XP .stringValue mjProd0Pol0Res
210+ tlog $ " got metajelo ref policy " <> mjProd0Pol0
211+ Assert .equal RT .string_type (XP .resultType mjProd0Pol0Res)
212+ Assert .equal " http://skGHargw/" mjProd0Pol0
213+ --
214+ mjProd0Pol0AppliesRes <- liftEffect $ XP .evaluate
215+ (prod0pol0xpath <> " /@appliesToProduct" )
216+ metajelo
217+ (Just mjNSresolver)
218+ RT .string_type
219+ Nothing
220+ metajeloDoc
221+ mjProd0Pol0Applies <- liftEffect $ XP .stringValue mjProd0Pol0AppliesRes
222+ tlog $ " got metajelo policy appliesToProduct: " <> (show mjProd0Pol0Applies)
223+ Assert .equal RT .string_type (XP .resultType mjProd0Pol0AppliesRes)
224+ Assert .equal " 0" mjProd0Pol0Applies
225+
198226tlog :: forall a . Show a => a -> Aff Unit
199227tlog = liftEffect <<< logShow
You can’t perform that action at this time.
0 commit comments