Title: Getting list numbering · Issue #180 · python-openxml/python-docx · GitHub
Open Graph Title: Getting list numbering · Issue #180 · python-openxml/python-docx
X Title: Getting list numbering · Issue #180 · python-openxml/python-docx
Description: Hi all, I`m wondering how can I get list numbering of paragraphs with style "Paragraph List" So far I got such thoughts: numId_val = paragraph._element.pPr.numPr.numId.val # getting value for
Open Graph Description: Hi all, I`m wondering how can I get list numbering of paragraphs with style "Paragraph List" So far I got such thoughts: numId_val = paragraph._element.pPr.numPr.numId.val # getting value for X Description: Hi all, I`m wondering how can I get list numbering of paragraphs with style "Paragraph List" So far I got such thoughts: numId_val = paragraph._element.pPr.numPr.numId.val # getting value...
Opengraph URL: https://github.com/python-openxml/python-docx/issues/180
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Getting list numbering","articleBody":"Hi all,\n\nI`m wondering how can I get list numbering of paragraphs with style \"Paragraph List\"\nSo far I got such thoughts: \n\n``` python\nnumId_val = paragraph._element.pPr.numPr.numId.val # getting value for \u003cw:num\u003e in numbering.xml\n```\n\nNext step should be finding \u003cw:num\u003e which corresponds to numId, that I got above\n\n``` python\nnum_obj = filter(lambda x: x.numId == numId_val, document.part.numbering_part.element.num_lst)[0]\n```\n\nThen look into \u003cw:AbstractNum\u003e to get ordering info (such as start value ...)\n\n``` python\nabsNum_obj = num_obj.abstractNumId\n```\n\nAnd that is fail, because it does not represent what I see in xml, \nI get smth like this\n\n``` python\nprint absNum_obj.xml\n```\n\n``` xml\n\u003cw:abstractNumId xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" w:val=\"0\"/\u003e\n```\n\nInstead of \n\n``` xml\n\u003cw:abstractNum w:abstractNumId=\"0\"\u003e\n \u003cw:nsid w:val=\"00000012\" /\u003e \n \u003cw:multiLevelType w:val=\"hybridMultilevel\" /\u003e \n \u003cw:tmpl w:val=\"31AE522E\" /\u003e \n- \u003cw:lvl w:ilvl=\"0\" w:tplc=\"0419000F\"\u003e\n \u003cw:start w:val=\"1\" /\u003e \n \u003cw:numFmt w:val=\"decimal\" /\u003e \n \u003cw:lvlText w:val=\"%1.\" /\u003e \n \u003cw:lvlJc w:val=\"left\" /\u003e \n- \u003cw:pPr\u003e\n- \u003cw:tabs\u003e\n \u003cw:tab w:val=\"left\" w:pos=\"720\" /\u003e \n \u003c/w:tabs\u003e\n \u003cw:ind w:left=\"720\" w:hanging=\"360\" /\u003e \n \u003c/w:pPr\u003e\n \u003c/w:lvl\u003e\n....\n\u003c/w:abstractNum\u003e\n```\n\nAnd more, if I manage to get start value, I will have to manually count paragraphs with same level id, then increase start value and only after that I will get numbering of paragraph.\n\nMaybe there is more straightforward and easy way?\n\nThanks\n","author":{"url":"https://github.com/norecces","@type":"Person","name":"norecces"},"datePublished":"2015-04-29T16:35:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/180/python-docx/issues/180"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:4dd04b1e-ab25-d67a-cd81-9282cc0552e8 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 8A70:1CE4C:188CE75:225310A:696F526C html-safe-nonce 87bb9e3039c9763873cb1cbc0af18bde24a137ea701ad4bba9efbc88ae949051 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTcwOjFDRTRDOjE4OENFNzU6MjI1MzEwQTo2OTZGNTI2QyIsInZpc2l0b3JfaWQiOiI3MDQ4OTUxNTA2Nzk0NDAyNDEyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac 9666764c6f8a9218a5806e8872c915c0c395a48a7f8b6b5efbab1cab21fedc11 hovercard-subject-tag issue:71924480 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openxml/python-docx/180/issue_layout twitter:image https://opengraph.githubassets.com/acf79725f850ef022b45d0c4fe92e3b0187677ff166e90402ce18b43c5ea79c9/python-openxml/python-docx/issues/180 twitter:card summary_large_image og:image https://opengraph.githubassets.com/acf79725f850ef022b45d0c4fe92e3b0187677ff166e90402ce18b43c5ea79c9/python-openxml/python-docx/issues/180 og:image:alt Hi all, I`m wondering how can I get list numbering of paragraphs with style "Paragraph List" So far I got such thoughts: numId_val = paragraph._element.pPr.numPr.numId.val # getting value for og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username norecces hostname github.com expected-hostname github.com None 49bb2ee76ae1b4ec758faefafda636ff20b05a9708bb290d28422cdf542ae979 turbo-cache-control no-preview go-import github.com/python-openxml/python-docx git https://github.com/python-openxml/python-docx.git octolytics-dimension-user_id 3403760 octolytics-dimension-user_login python-openxml octolytics-dimension-repository_id 13592924 octolytics-dimension-repository_nwo python-openxml/python-docx octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 13592924 octolytics-dimension-repository_network_root_nwo python-openxml/python-docx turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 036f37fe552777ac9c6ee661957f947285aab936 ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.