-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for example: Replacing a DOM element #115
Comments
Just following up on this. |
Your question is a bit vague, it would be better if you could provide an example of the desired input/output and how you attempted to implement it. -- Both input and output are a stream of XML events
solution :: Conduit Event m Event
solution = parseElements .| replaceElement .| renderElements
-- Implement here what you mean by "HTML element"
data Element
-- Then implement those conduits
parseElements :: Conduit Event m Element
replaceElement :: Conduit Element m Element
renderElements :: Conduit Element m Event |
Actually, the question is probably simpler than it sounds. I haven't been
able to figure out how to use the DOM mutation APIs exposed by these
libraries. Did I miss a tutorial/doc?
…On 22-Oct-2017 7:23 PM, "k0ral" ***@***.***> wrote:
Your question is a bit vague, it would be better if you could provide an
example of the desired input/output and how you attempted to implement it.
From what I understand, you might want something like this:
-- Both input and output are a stream of XML eventssolution :: Conduit Event m Event
solution = parseElements .| replaceElement .| renderElements
-- Implement here what you mean by "HTML element"data Element
-- Then implement those conduitsparseElements :: Conduit Event m ElementreplaceElement :: Conduit Element m ElementrenderElements :: Conduit Element m Event
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#115 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABu0bz8-WxENjXujdSFa8fDOzkhagd6ks5su0jSgaJpZM4Pu0H1>
.
|
I've been looking at
https://hackage.haskell.org/package/xml-conduit-1.7.0/docs/Text-XML-Cursor.html
and all the functions seems they're for querying / reading XML elements,
not mutating/writing them.
…On 22-Oct-2017 7:32 PM, "Saurabh Nanda" ***@***.***> wrote:
Actually, the question is probably simpler than it sounds. I haven't been
able to figure out how to use the DOM mutation APIs exposed by these
libraries. Did I miss a tutorial/doc?
On 22-Oct-2017 7:23 PM, "k0ral" ***@***.***> wrote:
> Your question is a bit vague, it would be better if you could provide an
> example of the desired input/output and how you attempted to implement it.
> From what I understand, you might want something like this:
>
> -- Both input and output are a stream of XML eventssolution :: Conduit Event m Event
> solution = parseElements .| replaceElement .| renderElements
> -- Implement here what you mean by "HTML element"data Element
> -- Then implement those conduitsparseElements :: Conduit Event m ElementreplaceElement :: Conduit Element m ElementrenderElements :: Conduit Element m Event
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#115 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AABu0bz8-WxENjXujdSFa8fDOzkhagd6ks5su0jSgaJpZM4Pu0H1>
> .
>
|
Indeed,
|
Actually, what's stopping an |
Can the xml-conduit family of libraries be used to replace an HTML element with another HTML element (say, the output of Lucid) and render the output? I've been struggling to figure something out from the docs, but haven't been able to do so yet.
The text was updated successfully, but these errors were encountered: